]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/theme/theme.service.ts
Merge branch 'release/4.0.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / core / theme / theme.service.ts
index 0c7dec0a127cbfdd3c78ae16ade88c8d2abb6cd6..ac34689419df7a271cb7edc05ace477904083e85 100644 (file)
@@ -95,8 +95,8 @@ export class ThemeService {
   private loadTheme (name: string) {
     const links = document.getElementsByTagName('link')
     for (let i = 0; i < links.length; i++) {
-      const link = links[ i ]
-      if (link.getAttribute('rel').indexOf('style') !== -1 && link.getAttribute('title')) {
+      const link = links[i]
+      if (link.getAttribute('rel').includes('style') && link.getAttribute('title')) {
         link.disabled = link.getAttribute('title') !== name
       }
     }
@@ -114,6 +114,7 @@ export class ThemeService {
     const theme = this.getTheme(currentTheme)
     if (theme) {
       console.log('Adding scripts of theme %s.', currentTheme)
+
       this.pluginService.addPlugin(theme, true)
 
       this.pluginService.reloadLoadedScopes()
@@ -140,7 +141,6 @@ export class ThemeService {
     }
 
     this.auth.userInformationLoaded
-      .pipe(first())
       .subscribe(() => this.updateCurrentTheme())
   }