mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-16 17:55:13 +00:00
Fix #1873
This commit is contained in:
parent
dfc213a19a
commit
77aa50ef19
1 changed files with 6 additions and 3 deletions
|
@ -251,9 +251,12 @@ import SwiftUI
|
||||||
|
|
||||||
func handleEvent(event: any StreamEvent, currentAccount: CurrentAccount) {
|
func handleEvent(event: any StreamEvent, currentAccount: CurrentAccount) {
|
||||||
if let event = event as? StreamEventUpdate {
|
if let event = event as? StreamEventUpdate {
|
||||||
if event.status.account.id == currentAccount.account?.id, selectedTab == .statuses {
|
if event.status.account.id == currentAccount.account?.id {
|
||||||
statuses.insert(event.status, at: 0)
|
if (event.status.inReplyToId == nil && selectedTab == .statuses) ||
|
||||||
statusesState = .display(statuses: statuses, nextPageState: .hasNextPage)
|
(event.status.inReplyToId != nil && selectedTab == .replies) {
|
||||||
|
statuses.insert(event.status, at: 0)
|
||||||
|
statusesState = .display(statuses: statuses, nextPageState: .hasNextPage)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if let event = event as? StreamEventDelete {
|
} else if let event = event as? StreamEventDelete {
|
||||||
statuses.removeAll(where: { $0.id == event.status })
|
statuses.removeAll(where: { $0.id == event.status })
|
||||||
|
|
Loading…
Reference in a new issue