diff --git a/src/app/components/stream/stream-statuses/stream-statuses.component.ts b/src/app/components/stream/stream-statuses/stream-statuses.component.ts index 14be2596..f67ac615 100644 --- a/src/app/components/stream/stream-statuses/stream-statuses.component.ts +++ b/src/app/components/stream/stream-statuses/stream-statuses.component.ts @@ -90,7 +90,7 @@ export class StreamStatusesComponent implements OnInit, OnDestroy { this.hideAccountSubscription = this.notificationService.hideAccountUrlStream.subscribe((accountUrl: string) => { if (accountUrl) { this.statuses = this.statuses.filter(x => { - if(x.status.reblog){ + if (x.status.reblog) { return x.status.reblog.account.url != accountUrl; } else { return x.status.account.url != accountUrl; @@ -98,7 +98,7 @@ export class StreamStatusesComponent implements OnInit, OnDestroy { }); this.bufferStream = this.bufferStream.filter(x => { - if(x.reblog){ + if (x.reblog) { return x.reblog.account.url != accountUrl; } else { return x.account.url != accountUrl; @@ -157,6 +157,9 @@ export class StreamStatusesComponent implements OnInit, OnDestroy { this.bufferStream.push(update.status); } } + } else if (update.type === EventEnum.delete) { + this.statuses = this.statuses.filter(x => !(x.status.id === update.messageId && this.account.id === update.account.id)); + this.bufferStream = this.bufferStream.filter(x => !(x.id === update.messageId && x.url.replace('https://', '').split('/')[0] === update.account.instance)); } } diff --git a/src/app/services/streaming.service.ts b/src/app/services/streaming.service.ts index 8f08c4cb..6f65bcf7 100644 --- a/src/app/services/streaming.service.ts +++ b/src/app/services/streaming.service.ts @@ -101,6 +101,7 @@ export class StreamingWrapper { case 'delete': newUpdate.type = EventEnum.delete; newUpdate.messageId = event.payload; + newUpdate.account = this.account; break; default: newUpdate.type = EventEnum.unknow; @@ -147,7 +148,8 @@ class WebSocketEvent { export class StatusUpdate { type: EventEnum; status: Status; - messageId: number; + messageId: string; + account: AccountInfo; } export enum EventEnum {