Эх сурвалжийг харах

archiveChat() already marks things as being notices; the extra call to marknoticedChat() is not needed when we update removeNotificationsForChat() after archiving

B. Petersen 3 жил өмнө
parent
commit
2fed832a42

+ 1 - 2
deltachat-ios/ViewModel/ChatListViewModel.swift

@@ -183,11 +183,10 @@ class ChatListViewModel: NSObject {
     func archiveChatToggle(chatId: Int) {
         let chat = dcContext.getChat(chatId: chatId)
         let isArchivedBefore = chat.isArchived
+        dcContext.archiveChat(chatId: chatId, archive: !isArchivedBefore)
         if !isArchivedBefore {
-            dcContext.marknoticedChat(chatId: chatId)
             NotificationManager.removeNotificationsForChat(dcContext: dcContext, chatId: chatId)
         }
-        dcContext.archiveChat(chatId: chatId, archive: !isArchivedBefore)
         updateChatList(notifyListener: false)
     }