Skip to content

Commit

Permalink
Updated delete sync flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Sathyan-KM committed Apr 4, 2024
1 parent 7a933f3 commit 85a7120
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Sources/Kommunicate/Classes/KMConversationListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,21 @@ public class KMConversationListViewController: ALKBaseViewController, Localizabl
}

private func deleteConversation(conversation: ALMessage) {
ALChannelDBService().deleteChannel(conversation.groupId)
self.conversationListTableViewController.tableView.reloadData()
ALMessageService().deleteMessageThread(nil, orChannelKey: conversation.groupId, withCompletion: {
_, error in
guard error == nil else {
print("Pakka101 Failed to delete the conversation: \(error.debugDescription)")

return
}
})

DispatchQueue.main.asyncAfter(deadline: .now() + 1.0, execute: {
let channelDbService = ALChannelDBService()
channelDbService.deleteChannel(conversation.groupId)
self.viewModel.remove(message: conversation)
self.tableView.reloadData()
})
}

override public func removeObserver() {
Expand Down

0 comments on commit 85a7120

Please sign in to comment.