]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/app.component.ts
Add mascot to 404 page
[github/Chocobozzz/PeerTube.git] / client / src / app / app.component.ts
index f686410478d5028a590eab88677d7e988f57fa04..1724bbd1ac440c99ed28b415e752a69c6849069f 100644 (file)
@@ -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
@@ -244,15 +244,19 @@ export class AppComponent implements OnInit {
     if (user.noWelcomeModal !== true) return this.welcomeModal.show()
 
     const config = this.serverService.getConfig()
-
-    if (user.noInstanceConfigWarningModal !== true && config.signup.allowed && config.instance.name.toLowerCase() === 'peertube') {
-      this.instanceService.getAbout()
-        .subscribe(about => {
-          if (!about.instance.terms) {
-            this.instanceConfigWarningModal.show()
-          }
-        })
-    }
+    if (user.noInstanceConfigWarningModal === true || !config.signup.allowed) return
+
+    this.instanceService.getAbout()
+      .subscribe(about => {
+        if (
+          config.instance.name.toLowerCase() === 'peertube' ||
+          !about.instance.terms ||
+          !about.instance.administrator ||
+          !about.instance.maintenanceLifetime
+        ) {
+          this.instanceConfigWarningModal.show(about)
+        }
+      })
   }
 
   private initHotkeys () {