Reload page in framework7

Hi!, I’m using Framework7 version: 5.4.1

In index.html (’/’) I have a login button, that open a login.html (/login/) page. This page send a request, and if it’s logged correctly, I save de ID of user in localstorage and redirect to index.html (’/’).

In index, I modify the login button if the user are logged, hiding the button, and showing a message:

if(localStorage.getItem(‘idCliente’) == ‘’){
$(’#login’).html(‘Login’)
}else{
$(’#login’).html(‘Welcome’ + localStorage.getItem(‘nombreCliente’)+’ Salir’ )
}

Redirection works, but not reload a Dom. Does not show the button or text. If I reload page (F5), show the wellcome + user message.

I try clear history, and other route options, but does not work.

app.views.main.router.clearPreviousHistory()
app.views.main.router.navigate(’/’, {
reloadCurrent: true,
ignoreCache: true,
});

Лучше начать с чтения документации, так как приведенный код вообще, конечно, плохой.

Если код $(’#login’).html(‘’) не изменяет DOM, то посмотри, есть ли такой элемент вообще в DOM.

It works only the first time that open page, or if I force reload page (F5), but not if I redirect to it.

I have found a solution adding the dom modifier in pageBeforeIn event of index page.

Thanks