Question:
i have pages that have text which shows up when a user is logged in, and then the same text is hidden when they are logged out. I have been using this code to run this for the past 4-5 months without any issues. But yesterday the code just seemed to stop working now I can’t get the hidden text to appear when the users try to log into my website. Does anyone know if there has been an update or if I made a mistake in the code?
Here is the code below & the affected element tags I commented saying “not showing”:
import wixUsers from ‘wix-users’;
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;$w.onReady(() => {
const user = wixUsers.currentUser;
const userId = user.id;
const loggedIn = user.loggedIn;if (wixUsers.currentUser.loggedIn) { $w('#text138').show(); //not showing $w('#text139').hide(); } else { $w('#text139').show(); $w('#text138').hide(); }
});
Product:
I am working on Wix Studio
What are you trying to achieve:
I want the hidden text to appear when a user is logged in.
What have you already tried:
I’ve tried just renaming the elements in the code and also looked for other people with similar issues but couldn’t find anyone
Additional information:
I’ve attached images of what the page should look like and also what’s currently happening and what the code panel shows when i preview the page. This issue is going on throughout my site. the code i posted is from another page but the images I attached basically shows the issue as a whole.
code panel in preview
Current homepage (broken)
What home page should look like
Thanks for any help!