Fix crash when loading DMs in the background
Changelog-Fixed: Fix crash when loading DMs in the background
This commit is contained in:
@@ -951,7 +951,7 @@ func handle_incoming_dms(prev_events: NewEventsBits, dms: DirectMessagesModel, o
|
|||||||
|
|
||||||
if inserted {
|
if inserted {
|
||||||
Task.init {
|
Task.init {
|
||||||
let new_dms = dms.dms.filter({ $0.events.count > 0 }).sorted { a, b in
|
let new_dms = Array(dms.dms.filter({ $0.events.count > 0 })).sorted { a, b in
|
||||||
return a.events.last!.created_at > b.events.last!.created_at
|
return a.events.last!.created_at > b.events.last!.created_at
|
||||||
}
|
}
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
|
|||||||
Reference in New Issue
Block a user