-import { fromEvent, Observable, Subject, Subscription } from 'rxjs'
+import { fromEvent, Observable, ReplaySubject, Subject, Subscription } from 'rxjs'
import { debounceTime, switchMap, tap } from 'rxjs/operators'
import {
AfterContentInit,
syndicationItems: Syndication[] = []
loadOnInit = true
- useUserVideoPreferences = false
+ loadUserVideoPreferences = false
+
ownerDisplayType: OwnerDisplayType = 'account'
displayModerationBlock = false
titleTooltip: string
userMiniature: User
+ protected onUserLoadedSubject = new ReplaySubject<void>(1)
+
protected serverConfig: ServerConfig
protected abstract notifier: Notifier
this.calcPageSizes()
const loadUserObservable = this.loadUserAndSettings()
+ loadUserObservable.subscribe(() => {
+ this.onUserLoadedSubject.next()
- if (this.loadOnInit === true) {
- loadUserObservable.subscribe(() => this.loadMoreVideos())
- }
+ if (this.loadOnInit === true) this.loadMoreVideos()
+ })
this.userService.listenAnonymousUpdate()
.pipe(switchMap(() => this.loadUserAndSettings()))
.pipe(tap(user => {
this.userMiniature = user
- if (!this.useUserVideoPreferences) return
+ if (!this.loadUserVideoPreferences) return
this.languageOneOf = user.videoLanguages
this.nsfwPolicy = user.nsfwPolicy