diff --git a/Session/Conversations/ConversationViewModel.swift b/Session/Conversations/ConversationViewModel.swift index bce363220..060ef3040 100644 --- a/Session/Conversations/ConversationViewModel.swift +++ b/Session/Conversations/ConversationViewModel.swift @@ -882,21 +882,11 @@ public class ConversationViewModel: OWSAudioPlayerDelegate, NavigatableStateHold let threadId: String = self.threadId let displayName: String = self._threadData.wrappedValue.displayName - Storage.shared.writeAsync( - updates: { db in - try Contact - .filter(id: threadId) - .updateAllAndConfig(db, Contact.Columns.isBlocked.set(to: false)) - }, - completion: { [weak self] _, _ in - self?.showToast( - text: "blockUnblockedUser" - .put(key: "name", value: displayName) - .localized(), - backgroundColor: .backgroundSecondary - ) - } - ) + Storage.shared.writeAsync { db in + try Contact + .filter(id: threadId) + .updateAllAndConfig(db, Contact.Columns.isBlocked.set(to: false)) + } } public func expandReactions(for interactionId: Int64) { diff --git a/Session/Conversations/Settings/ThreadSettingsViewModel.swift b/Session/Conversations/Settings/ThreadSettingsViewModel.swift index a9a136c9d..60e3edfc3 100644 --- a/Session/Conversations/Settings/ThreadSettingsViewModel.swift +++ b/Session/Conversations/Settings/ThreadSettingsViewModel.swift @@ -832,29 +832,13 @@ class ThreadSettingsViewModel: SessionTableViewModel, NavigationItemSource, Navi ) { guard oldBlockedState != isBlocked else { return } - dependencies.storage.writeAsync( - updates: { db in - try Contact - .filter(id: threadId) - .updateAllAndConfig( - db, - Contact.Columns.isBlocked.set(to: isBlocked) - ) - }, - completion: { [weak self] _, _ in - self?.showToast( - text: ( - isBlocked ? - "blockBlockedUser" - .put(key: "name", value: displayName) - .localized() : - "blockUnblockedUser" - .put(key: "name", value: displayName) - .localized() - ), - backgroundColor: .backgroundSecondary + dependencies.storage.writeAsync { db in + try Contact + .filter(id: threadId) + .updateAllAndConfig( + db, + Contact.Columns.isBlocked.set(to: isBlocked) ) - } - ) + } } }