hide muted/blocked accounts in thread
This commit is contained in:
parent
90157c1ee7
commit
bdd6a1b1f3
|
@ -39,6 +39,7 @@ export class ThreadComponent implements OnInit, OnDestroy {
|
||||||
@ViewChildren(StatusComponent) statusChildren: QueryList<StatusComponent>;
|
@ViewChildren(StatusComponent) statusChildren: QueryList<StatusComponent>;
|
||||||
|
|
||||||
private newPostSub: Subscription;
|
private newPostSub: Subscription;
|
||||||
|
private hideAccountSubscription: Subscription;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly notificationService: NotificationService,
|
private readonly notificationService: NotificationService,
|
||||||
|
@ -69,12 +70,23 @@ export class ThreadComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.hideAccountSubscription = this.notificationService.hideAccountUrlStream.subscribe((accountUrl: string) => {
|
||||||
|
if (accountUrl) {
|
||||||
|
this.statuses = this.statuses.filter(x => {
|
||||||
|
if(x.status.reblog){
|
||||||
|
return x.status.reblog.account.url != accountUrl;
|
||||||
|
} else {
|
||||||
|
return x.status.account.url != accountUrl;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
if (this.newPostSub) {
|
if (this.newPostSub) this.newPostSub.unsubscribe();
|
||||||
this.newPostSub.unsubscribe();
|
if (this.hideAccountSubscription) this.hideAccountSubscription.unsubscribe();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private getThread(openThreadEvent: OpenThreadEvent) {
|
private getThread(openThreadEvent: OpenThreadEvent) {
|
||||||
|
|
Loading…
Reference in New Issue