Fix theme loading
authorChocobozzz <me@florianbigard.com>
Fri, 13 Dec 2019 08:32:36 +0000 (09:32 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 13 Dec 2019 08:33:06 +0000 (09:33 +0100)
client/src/app/core/theme/theme.service.ts
client/src/app/videos/+video-watch/video-watch.component.ts

index 9be8e7a2d2a6dd04d165f8757a0f031a415d36d2..3eebc1acc8e7142e44b8d3d14ea6a7be5af1cf23 100644 (file)
@@ -5,6 +5,7 @@ import { environment } from '../../../environments/environment'
 import { PluginService } from '@app/core/plugins/plugin.service'
 import { ServerConfigTheme } from '@shared/models'
 import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage'
+import { first } from 'rxjs/operators'
 
 @Injectable()
 export class ThemeService {
@@ -123,6 +124,7 @@ export class ThemeService {
     }
 
     this.auth.userInformationLoaded
+      .pipe(first())
       .subscribe(() => this.updateCurrentTheme())
   }
 
index 8378e83b8289123aa21472f6b75e9bcb0fff9d2a..12b74a846586e5252ed408e0779b660f869ddda7 100644 (file)
@@ -279,14 +279,14 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
 
   isAutoPlayEnabled () {
     return (
-      this.user && this.user.autoPlayNextVideo ||
+      (this.user && this.user.autoPlayNextVideo) ||
       peertubeSessionStorage.getItem(RecommendedVideosComponent.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO) === 'true'
     )
   }
 
   isPlaylistAutoPlayEnabled () {
     return (
-      this.user && this.user.autoPlayNextVideoPlaylist ||
+      (this.user && this.user.autoPlayNextVideoPlaylist) ||
       peertubeSessionStorage.getItem(VideoWatchPlaylistComponent.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO_PLAYLIST) === 'true'
     )
   }