How to reset pageInit status?

Hi @nolimits4web,

Probably this has been asked before, but I cannot find an answer in the forum or docs. I am developing a web site using F7 using the Aurora theme. This saves me a lot of time, as I have to develop an app for it, too. The problem is that a user logs in, and some initialization code is run in pageInit(). Now the user logs off, and another user logs in, without closing the browser, so F7 does not fire pageInit() again. Reading the docs, it seemed that app.views.main.router.clearPreviousHistory() should do the trick, but after checking, it does not. I am not sure if it is relevant, but $$('') is not empty, too, while the docs say that ‘Clear router previous pages history and remove all previous pages from DOM’.

What is the best way to get around this? I used stacked pages with pushState set to true, if it matters. Is there any way also to invalidate pages in the browser history, so the new user cannot see the previous ones?

Is there anything like resetAll()? :smile: Thank you!

If it is a Router/Vue/React/Svelte page component then you need to properly update page state with this.$setState({ ... some default state... })

I do not get your point…

I came up with a simple simple solution: on logout, I redirect user to another HTML file which, on the other hand, redirects back to the main HTML file with stacked pages. To avoid a loop, I use the sessionStorage. This effectively resets the browser, and I get the desired results. What do you think?