Async Route dont animate [V2]

Hi, i,ve was learning how to use Framework7 V2 and i have a problem using Async Route, when i use this, i set resolve({url: ‘pages/login.html’}); for redirect to login page but dont animate the login page and pageInit dont work, what i can do?

this is my code

routes: [
    {
      path: '/',
      url: 'pages/welcome.html',
      async(routeTo, routeFrom, resolve, reject) {
        setTimeout(function(){
          if (app.methods.userIsLoggedIn===true) {
            resolve({url: 'pages/inicio.html'});
          } else {
            resolve({url: 'pages/login.html'});
          }
        }, 2000);
      },
    },
    {
      path: '/login/',
      url: 'pages/login.html',
      on: {
        pageInit: function (e, page) {
          console.log('login');
        }
      }
    },
]

There is no sense here to use both url and async props. Use async only

1 Like

Also, don’t know what is in your app.methods, but methods supposed to be a function

1 Like