Hi, I have a piece of code that check my database to see if a record was created. If a record was created it collapses a button and some text boxes. If no record found it opens a new member page. It worked fine on older versions of chrome and IE but crashes on the newest versions of Chrome and IE. Not sure why but I hope someone might be able to provide me with some alternative code to fix it.
Thanks, Mark
The code:
import wixData from ‘wix-data’ ;
import wixWindow from ‘wix-window’ ;
// Checks to see if user has a record in ppocc_members. If not send them to the Member Profile Creation Page - added 10_28_2020 from Conditional - looking up database “owner” field 3_4_2018
import wixUsers from ‘wix-users’;
//export function button1_onclick() {
wixData.query(“ppocc_members”)
.eq("_owner", wixUsers.currentUser.id)
.find()
.then( (results) => {
if (results.items.length === 0)
{
wixLocation.to(/member-profile-creation
);
}
else
{
wixLocation.to(/member-referral-page${wixUsers.currentUser.id}
);
$w(“#firstprofile”).collapse();
$w(“#vectorImage3”).collapse();
$w(“#text67”).collapse();
$w(“#text123”).collapse();
}
});
//}
// end Checks to see if user has a record in ppocc_members. If not send them to the Member Profile Creation Page - added 10_28_2020