]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/theme/theme.service.ts
Add client helpers to plugins
[github/Chocobozzz/PeerTube.git] / client / src / app / core / theme / theme.service.ts
index ad59c203be07d79abe8a826a4407ee9d9be93777..0124880751ec041769dce87fda37eafff1fcf7b9 100644 (file)
@@ -83,10 +83,11 @@ export class ThemeService {
     console.log('Enabling %s theme.', currentTheme)
 
     this.loadTheme(currentTheme)
+
     const theme = this.getTheme(currentTheme)
     if (theme) {
       console.log('Adding scripts of theme %s.', currentTheme)
-      this.pluginService.addPlugin(theme)
+      this.pluginService.addPlugin(theme, true)
 
       this.pluginService.reloadLoadedScopes()
     }
@@ -95,6 +96,10 @@ export class ThemeService {
   }
 
   private listenUserTheme () {
+    if (!this.auth.isLoggedIn()) {
+      this.updateCurrentTheme()
+    }
+
     this.auth.userInformationLoaded
       .subscribe(() => this.updateCurrentTheme())
   }