From 178634d581d602dc6a4a5b1670efe993bcee8122 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Thu, 1 Aug 2024 21:56:39 +0100 Subject: [PATCH] diff --- apps/ios/Shared/Model/ChatModel.swift | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/apps/ios/Shared/Model/ChatModel.swift b/apps/ios/Shared/Model/ChatModel.swift index 21674e3960..20449299eb 100644 --- a/apps/ios/Shared/Model/ChatModel.swift +++ b/apps/ios/Shared/Model/ChatModel.swift @@ -289,7 +289,6 @@ final class ChatModel: ObservableObject { } func updateChats(with newChats: [ChatData]) { - var chatsToPop: Set = [] for i in 0..) { - chatsToPop = chatsToPop.union(chatIds) - subject.send() - } - + func popRecentChats() { let m = ChatModel.shared var chs: [(Int, Chat)] = [] @@ -676,11 +669,6 @@ final class ChatModel: ObservableObject { } } - private func popChat_(_ i: Int, to position: Int = 0) { - let chat = chats.remove(at: i) - chats.insert(chat, at: position) - } - private func markChatItemRead_(_ i: Int) { let meta = im.reversedChatItems[i].meta if case .rcvNew = meta.itemStatus { @@ -774,6 +762,11 @@ final class ChatModel: ObservableObject { return (prevMember, memberIds.count) } + private func popChat_(_ i: Int, to position: Int = 0) { + let chat = chats.remove(at: i) + chats.insert(chat, at: position) + } + func dismissConnReqView(_ id: String) { if id == showingInvitation?.connId { markShowingInvitationUsed()