aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-miniature
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-video-miniature')
-rw-r--r--client/src/app/shared/shared-video-miniature/abstract-video-list.ts16
1 files changed, 10 insertions, 6 deletions
diff --git a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts
index 5361f6d6c..f8abc1656 100644
--- a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts
+++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts
@@ -1,4 +1,4 @@
1import { fromEvent, Observable, Subject, Subscription } from 'rxjs' 1import { fromEvent, Observable, ReplaySubject, Subject, Subscription } from 'rxjs'
2import { debounceTime, switchMap, tap } from 'rxjs/operators' 2import { debounceTime, switchMap, tap } from 'rxjs/operators'
3import { 3import {
4 AfterContentInit, 4 AfterContentInit,
@@ -63,7 +63,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte
63 syndicationItems: Syndication[] = [] 63 syndicationItems: Syndication[] = []
64 64
65 loadOnInit = true 65 loadOnInit = true
66 useUserVideoPreferences = false 66 loadUserVideoPreferences = false
67
67 ownerDisplayType: OwnerDisplayType = 'account' 68 ownerDisplayType: OwnerDisplayType = 'account'
68 displayModerationBlock = false 69 displayModerationBlock = false
69 titleTooltip: string 70 titleTooltip: string
@@ -98,6 +99,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte
98 99
99 userMiniature: User 100 userMiniature: User
100 101
102 protected onUserLoadedSubject = new ReplaySubject<void>(1)
103
101 protected serverConfig: ServerConfig 104 protected serverConfig: ServerConfig
102 105
103 protected abstract notifier: Notifier 106 protected abstract notifier: Notifier
@@ -149,10 +152,11 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte
149 this.calcPageSizes() 152 this.calcPageSizes()
150 153
151 const loadUserObservable = this.loadUserAndSettings() 154 const loadUserObservable = this.loadUserAndSettings()
155 loadUserObservable.subscribe(() => {
156 this.onUserLoadedSubject.next()
152 157
153 if (this.loadOnInit === true) { 158 if (this.loadOnInit === true) this.loadMoreVideos()
154 loadUserObservable.subscribe(() => this.loadMoreVideos()) 159 })
155 }
156 160
157 this.userService.listenAnonymousUpdate() 161 this.userService.listenAnonymousUpdate()
158 .pipe(switchMap(() => this.loadUserAndSettings())) 162 .pipe(switchMap(() => this.loadUserAndSettings()))
@@ -374,7 +378,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte
374 .pipe(tap(user => { 378 .pipe(tap(user => {
375 this.userMiniature = user 379 this.userMiniature = user
376 380
377 if (!this.useUserVideoPreferences) return 381 if (!this.loadUserVideoPreferences) return
378 382
379 this.languageOneOf = user.videoLanguages 383 this.languageOneOf = user.videoLanguages
380 this.nsfwPolicy = user.nsfwPolicy 384 this.nsfwPolicy = user.nsfwPolicy