I am trying to save the last route in my localstorage so that if a user hits a refresh button in their browser they would end up back on the tab they were last on. everything in here seems to work, except router.navigate refuses to do anything. am i not able to use router.navigate in the init block?
in my app.js:
on: {
init: function () {
var lastRoute = localStorage.getItem("lastRoute");
if(lastRoute && lastRoute != '/'){
this.router.navigate(lastRoute, {
reloadAll: true,
ignoreCache: true,
});
}
},
tabShow: function (tab) {
localStorage.setItem("lastRoute",app.views.main.router.url);
}
}, // end of on handler global params