Hello,
I created a Code to check my database for a user.
After clicking the “Zustimmen Button” a box should appear with the on.click function, if the user was found in my database.
If this user was not found then a Submit-Button should appear.
Somehow the Submit-Button always appear after one click, even if the user is in the database. Meanwhile, when I click the second time on the “Zustimmen Button” then the box appears.
So the user is found, but the box just appears after 2 clicks.
Here is the Code:
export function ZustimmenButton_click ( event,$w ) {
wixData . query ( ‘MitgliederGateway’ )
. eq ( “copyOwner” , $w ( ‘#MemberCopyOwner’ ). value )
. find ()
. then (( res ) => {
if ( res.totalCount > 0 ) {
$w ( ‘#box2’ ). show ();
}
else {
$w ( ‘#SubmitButton’ ). show ();
}
})
}
Any ideas, what is causing that and how can I fix it?
Thanks