So far I have…
let currentUser = wixUsers.currentUser;
function checkDB( ){
wixData.query(“myCollection”)
.eq(“user”, currentUser)
.find()
.then( (results) => {
if (results.items.length > 0){
$w(‘#button’).show();
}
else {
$w(‘#button’).hide();
}
} )
. catch ( (err) => {
let errorMsg = err;
} );
I think I’m really close here but I’m not getting the desired results…I also have the button I want to show set to Hide on Load.
Is that correct? What changes do I need to make to my code?