Status detail: Handle status update

This commit is contained in:
Thomas Ricouard 2023-03-15 14:55:45 +01:00
parent 6e47f9410d
commit 3e88d89de3
1 changed files with 7 additions and 7 deletions

View File

@ -109,14 +109,14 @@ class StatusDetailViewModel: ObservableObject {
} }
func handleEvent(event: any StreamEvent, currentAccount: Account?) { func handleEvent(event: any StreamEvent, currentAccount: Account?) {
Task {
if let event = event as? StreamEventUpdate, if let event = event as? StreamEventUpdate,
event.status.account.id == currentAccount?.id event.status.account.id == currentAccount?.id {
{ await fetchStatusDetail(animate: true)
Task { } else if let event = event as? StreamEventStatusUpdate,
event.status.account.id == currentAccount?.id {
await fetchStatusDetail(animate: true) await fetchStatusDetail(animate: true)
}
} else if event is StreamEventDelete { } else if event is StreamEventDelete {
Task {
await fetchStatusDetail(animate: true) await fetchStatusDetail(animate: true)
} }
} }