Oh, I didn’t noticethe “:” on the id.
At the moment, the lightbox is still appearing all the times.
This is the code I have now:
import wixUsers from ‘wix-users’;
import wixData from ‘wix-data’;
$w.onReady( function () {
let user = wixUsers.currentUser;
wixData.query(“oldUsers”)
.eq(“_id”, user.id)//check if the user id exist
.eq(“detailsFilled”, true ) // check if the details is filled out (True)
.find()
.then( (results) => {
if (results.items[0]){ //if the user id exist and the detailsFilled is True
console.log(“Not the first time,and details filled before”);
$w(“#lightbox1”).hide();
}
} );
});
(THIS IS THE WHOLE CODE OF MY PAGE, I DON’T HAVE ANYTHING ELSE ADDED)
since “#lightbox1” on the “my account” page is saying that it is not a valid sector, I placed this code on the lightbox instead, but it is still showing the lightbox to everybody. - I am not sure if this should be on the page or at the lightbox (where it doesn’t give me any error).
Finally, if I click “show properties” of the lightbox, it doesn’t show the “hidden onLoad”, only the “collapsed on load”, which is unchecked. For the lightbox to appear in the desired page (my account), I have set triggers so that the lightbox automatically displays on “my account” page.