added stream update on settings changes
This commit is contained in:
parent
b5f063b158
commit
dcb929eac3
|
@ -49,6 +49,8 @@ export class StreamStatusesComponent implements OnInit, OnDestroy {
|
||||||
@Input() userLocked = true;
|
@Input() userLocked = true;
|
||||||
|
|
||||||
private goToTopSubscription: Subscription;
|
private goToTopSubscription: Subscription;
|
||||||
|
private streamsSubscription: Subscription;
|
||||||
|
private streams$: Observable<StreamElement[]>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly store: Store,
|
private readonly store: Store,
|
||||||
|
@ -56,16 +58,23 @@ export class StreamStatusesComponent implements OnInit, OnDestroy {
|
||||||
private readonly notificationService: NotificationService,
|
private readonly notificationService: NotificationService,
|
||||||
private readonly streamingService: StreamingService,
|
private readonly streamingService: StreamingService,
|
||||||
private readonly mastodonService: MastodonService) {
|
private readonly mastodonService: MastodonService) {
|
||||||
|
|
||||||
|
this.streams$ = this.store.select(state => state.streamsstatemodel.streams);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.goToTopSubscription = this.goToTop.subscribe(() => {
|
this.goToTopSubscription = this.goToTop.subscribe(() => {
|
||||||
this.applyGoToTop();
|
this.applyGoToTop();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.streamsSubscription = this.streams$.subscribe((streams: StreamElement[]) => {
|
||||||
|
this.streamElement = streams.find(x => x.id === this.streamElement.id);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
if (this.goToTopSubscription) this.goToTopSubscription.unsubscribe();
|
if (this.goToTopSubscription) this.goToTopSubscription.unsubscribe();
|
||||||
|
if (this.streamsSubscription) this.streamsSubscription.unsubscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh(): any {
|
refresh(): any {
|
||||||
|
|
Loading…
Reference in New Issue