When I load it I need to check in local storage what user it is using the app, and then send the userid to the page and reload it so I can get the right records from the database based on the userid.
Well, then you can try to check page data object and to,from,position, direction props. They will be different after reload, and don’t reload page again
But such logic sounds a bit wrong. How the user can be changed during the session, there shouldn’t be such opportunity. In case user is logged out, you probably must to remove all navigation and user related pages from app. Also if you have a lot of binding logic I highly recommend you to switch to the F7+Vue, you won’t need to do any reloads there
But I don´t understand why it is not getting the data from the local storage if I do it like this.
Should´t this, first get the local storage data and THEN navigate? And I use page:init
if(localStorage && localStorage.getItem(‘installningar’)){
var readinstallningar = JSON.parse(localStorage.getItem(“installningar”));
var appusersId = readinstallningar[“appusersId”];
mainView.router.navigate("/pushnotiser/?userId="+appusersId,{reloadCurrent:true,force:true, ignoreCache: true});
}
And even if I set the timeout around it all it is reloading the page over and over. So the timeout is not running just one time? Why is that?
$$(document).on(‘page:init’, ‘.page[data-name=“pushnotiser”]’, function (e) {
var page = e.detail;
setTimeout(function(){
if(localStorage && localStorage.getItem(‘installningar’)){
var readinstallningar = JSON.parse(localStorage.getItem(“installningar”));
var appusersId = readinstallningar[“appusersId”];