Rendering at load

how to make sure that an element only renders if the user is not logged in, the trick is that on each page load we see it a little afterwards it leaves when it takes time to check the condition

i tried js, formula but not working

the javascript defines false as the default value and then checks whether the user is logged in or not. But even with this, the trick still appears a little at first

So is the variable explicitly set to false before the authentication is checked?
if not, you could probably use this, should return true only if it is explicitly set to false, not undefined.

let auth = variables['72025230-2be8-41bc-9af3-7bfeaccd6a9b']?.['isAuthenticated'];

// Return true only if auth is explicitly false
return auth === false;

If the variable is defined as false before true always, then we should ask for a similar variable to collections “isFetching”. But to get around it you could use a time delay, and make the message transition in a little later, after you are sure the auth server have/should have replied.

2 Likes

thank you! gonna test this

Unfortunately, it doesn’t work, it still displays during the fetching of the user. I created a ticket with weweb to get the xano auth variable so that the element is displayed only if the user is not logged in but ALSO if the user is fetching :slight_smile:

Capture d’écran 2024-04-12 à 03.49.33