mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-21 04:00:57 +03:00
Fixed bug where sometimes the config wouldn't be retrieved by the time canActivate would be executed
This commit is contained in:
@@ -233,6 +233,18 @@ export class PostsService implements CanActivate {
|
||||
|
||||
}
|
||||
canActivate(route: ActivatedRouteSnapshot, state): Promise<boolean> {
|
||||
if (this.initialized) {
|
||||
return this._canActivate(route);
|
||||
} else {
|
||||
this.service_initialized.subscribe(init => {
|
||||
if (init) {
|
||||
return this._canActivate(route);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_canActivate(route: ActivatedRouteSnapshot): Promise<boolean> {
|
||||
const PATH_TO_REQUIRED_PERM = {
|
||||
settings: 'settings',
|
||||
subscriptions: 'subscriptions',
|
||||
|
||||
Reference in New Issue
Block a user