pageInt run twice

Hello guys,

I have seen other posts like this that indicated that I simply need to verify the name of the pages and the routes but the name of the page is null

nome

My code:

App.js

pageInit: function (page) {
console.log(page, page.name);
userChecker();
footerContent();
}

userChecker part see if exist login session storage if not open login form like:

app.loginScreen.open(’#my-login-screen’, true);

Then use ajax for login.


Route:

import HomePage from ‘…/pages/home.f7’;
import AboutPage from ‘…/pages/about.f7’;
import NotFoundPage from ‘…/pages/404.f7’;

var routes = [
{
path: ‘/’,
component: HomePage,
},
{
path: ‘/about/’,
component: AboutPage,
},
{
path: ‘(.*)’,
component: NotFoundPage,
}
];

export default routes;

I just started so the code is little.
To overcome the problem at the moment I check name of page if is null like:

if (page.name !== null) {
console.log(page, page.name);
userChecker();
footerContent();
}

ididnt get that can u explain Tutuapp 9Apps Showbox

As you can see from the screenshot in the app.js file in the pageInit section, the pages that start are two, in this way all my commands start twice (eg userChecker), for now I have solved it by checking the page name if it is not null.