I’m having issues getting the following to work… For some reason the variable keeps evaluating as true regardless of the actual value…
====================================
export function inputSearch_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
console.log(session.getItem(“subscribed”));
let searchCheck = session.getItem(“subscribed”);
console.log(searchCheck);
if (searchCheck) {
console.log(“Subscribed for Search”);
search($w(“#inputSearch”).value, true);
} else {
console.log(“NOT Subscribed for Search”);
search($w(“#inputSearch”).value, false);
}
}, 200);
}
=======================================
console log:
false
false
Subscribed for Search
================================================
I should be getting “NOT Subscribed for Search” in the log, but my variable ‘searchCheck’ keeps being evaluated as true in the if statement. What’s going on here?