diff --git a/src/app/posts.services.ts b/src/app/posts.services.ts index cad691d..687a548 100644 --- a/src/app/posts.services.ts +++ b/src/app/posts.services.ts @@ -233,6 +233,18 @@ export class PostsService implements CanActivate { } canActivate(route: ActivatedRouteSnapshot, state): Promise { + if (this.initialized) { + return this._canActivate(route); + } else { + this.service_initialized.subscribe(init => { + if (init) { + return this._canActivate(route); + } + }); + } + } + + _canActivate(route: ActivatedRouteSnapshot): Promise { const PATH_TO_REQUIRED_PERM = { settings: 'settings', subscriptions: 'subscriptions',