+ })
+ }
+
+ private injectCSS () {
+ // Inject CSS if modified (admin config settings)
+ this.serverService.configReloaded
+ .subscribe(() => {
+ const headStyle = document.querySelector('style.custom-css-style')
+ if (headStyle) headStyle.parentNode.removeChild(headStyle)
+
+ // We test customCSS if the admin removed the css
+ if (this.customCSS || this.serverConfig.instance.customizations.css) {
+ const styleTag = '<style>' + this.serverConfig.instance.customizations.css + '</style>'
+ this.customCSS = this.domSanitizer.bypassSecurityTrustHtml(styleTag)
+ }
+ })
+ }
+
+ private async loadPlugins () {
+ this.pluginService.initializePlugins()
+
+ this.hooks.runAction('action:application.init', 'common')
+ }
+
+ private async openModalsIfNeeded () {
+ this.authService.userInformationLoaded
+ .pipe(
+ map(() => this.authService.getUser()),
+ filter(user => user.role === UserRole.ADMINISTRATOR)
+ ).subscribe(user => setTimeout(() => this._openAdminModalsIfNeeded(user))) // setTimeout because of ngIf in template
+ }
+
+ private async _openAdminModalsIfNeeded (user: User) {
+ if (user.noWelcomeModal !== true) return this.welcomeModal.show()
+
+ if (user.noInstanceConfigWarningModal === true || !this.serverConfig.signup.allowed) return
+
+ this.instanceService.getAbout()
+ .subscribe(about => {
+ if (
+ this.serverConfig.instance.name.toLowerCase() === 'peertube' ||
+ !about.instance.terms ||
+ !about.instance.administrator ||
+ !about.instance.maintenanceLifetime
+ ) {
+ this.instanceConfigWarningModal.show(about)