Hello, on my website I have setup my own member logih/account bar in the header, as the default one lacks certain functionality. I currently have two elements, a login button and an account button which are hidden by default. They are shown depending on whether a user is logged in but the site has to wait for the promise to resolve before the check completes.
As a result, I am left with a login/account button that appears after a short period on every page navigation. It disappears and reappears when they go from the home page to the about page and so on.
Here is a code snippet of my current “solution:”
currentMember . getMember ()
. then (( member ) => {
// Check if member is logged in
if ( member ) {
$w ( ‘#accountButton’ ). show ()
} else {
$w ( ‘#loginButtonHeader’ ). show ()
}
})
. catch (( e ) => {
console . error ( e );
});
Is there any way to get around this? The login bar obviously makes it work but that’s premade.