X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fapp.component.ts;h=f1658ca1bf3ec5f449066d3c40c9126e79b9a952;hb=d816f3a063febac1cad09ab3a32e5f0d29353627;hp=6b18e5feba9958a68a90e698de25208b30548663;hpb=589d9f55f6f3f0d069d4bbb207d3d20769cc4ded;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 6b18e5feb..f1658ca1b 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -4,7 +4,7 @@ import { Event, GuardsCheckStart, NavigationEnd, Router, Scroll } from '@angular import { AuthService, RedirectService, ServerService, ThemeService } from '@app/core' import { is18nPath } from '../../../shared/models/i18n' import { ScreenService } from '@app/shared/misc/screen.service' -import { debounceTime, filter, map, pairwise, skip, switchMap } from 'rxjs/operators' +import { debounceTime, filter, first, map, pairwise, skip, switchMap } from 'rxjs/operators' import { Hotkey, HotkeysService } from 'angular2-hotkeys' import { I18n } from '@ngx-translate/i18n-polyfill' import { fromEvent } from 'rxjs' @@ -71,6 +71,9 @@ export class AppComponent implements OnInit { ngOnInit () { document.getElementById('incompatible-browser').className += ' browser-ok' + this.loadPlugins() + this.themeService.initialize() + this.authService.loadClientCredentials() if (this.isUserLoggedIn()) { @@ -86,9 +89,6 @@ export class AppComponent implements OnInit { this.serverService.loadVideoPrivacies() this.serverService.loadVideoPlaylistPrivacies() - this.loadPlugins() - this.themeService.initialize() - // Do not display menu on small screens if (this.screenService.isInSmallView()) { this.isMenuDisplayed = false @@ -234,6 +234,7 @@ export class AppComponent implements OnInit { private async openModalsIfNeeded () { this.serverService.configLoaded .pipe( + first(), switchMap(() => this.authService.userInformationLoaded), map(() => this.authService.getUser()), filter(user => user.role === UserRole.ADMINISTRATOR)