mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-20 15:33:21 +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> {
|
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 = {
|
const PATH_TO_REQUIRED_PERM = {
|
||||||
settings: 'settings',
|
settings: 'settings',
|
||||||
subscriptions: 'subscriptions',
|
subscriptions: 'subscriptions',
|
||||||
|
|||||||
Reference in New Issue
Block a user