How to refresh content on login

Hello,
I am having a simple but hard to solve problem. I have a website that allows users to add their own content and store it is their collection. I allow them to login through a login button. The problem is that the user needs to click another “refresh” button to show their content. I wonder if it is possible to do this automatically after login.

My refresh button code(found it in this post ):

function NotLoggedIn() {
//hide/show content

}
function Normal() {
//hide/show content
}
$w("#button94").onClick (() =>{
 
if (wixUsers.currentUser.loggedIn) {
 Normal()
 } else {
 NotLoggedIn()
 }

})
$w.onReady(function() {
if (wixUsers.currentUser.loggedIn) {
 Normal()
 } else {
 NotLoggedIn()
 }
})

Arthur

I am trying to guess your setup.

Is there a reason why the page settings are not set to members only? Is there other data on that page that does not require login?

Are the elements being hidden simple Wix elements or elements connected to data?

Have you tried if logged in show element? If logged in refresh dataset? OnLogin show element? OnLogin refresh dataset? Something like that?

https://www.wix.com/velo/reference/wix-users/onlogin