remove unused block/unblock toast

pull/1023/head
Ryan ZHAO 1 year ago
parent 263844daba
commit 9b676a8083

@ -882,21 +882,11 @@ public class ConversationViewModel: OWSAudioPlayerDelegate, NavigatableStateHold
let threadId: String = self.threadId let threadId: String = self.threadId
let displayName: String = self._threadData.wrappedValue.displayName let displayName: String = self._threadData.wrappedValue.displayName
Storage.shared.writeAsync( Storage.shared.writeAsync { db in
updates: { db in
try Contact try Contact
.filter(id: threadId) .filter(id: threadId)
.updateAllAndConfig(db, Contact.Columns.isBlocked.set(to: false)) .updateAllAndConfig(db, Contact.Columns.isBlocked.set(to: false))
},
completion: { [weak self] _, _ in
self?.showToast(
text: "blockUnblockedUser"
.put(key: "name", value: displayName)
.localized(),
backgroundColor: .backgroundSecondary
)
} }
)
} }
public func expandReactions(for interactionId: Int64) { public func expandReactions(for interactionId: Int64) {

@ -832,29 +832,13 @@ class ThreadSettingsViewModel: SessionTableViewModel, NavigationItemSource, Navi
) { ) {
guard oldBlockedState != isBlocked else { return } guard oldBlockedState != isBlocked else { return }
dependencies.storage.writeAsync( dependencies.storage.writeAsync { db in
updates: { db in
try Contact try Contact
.filter(id: threadId) .filter(id: threadId)
.updateAllAndConfig( .updateAllAndConfig(
db, db,
Contact.Columns.isBlocked.set(to: isBlocked) 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
)
} }
)
} }
} }

Loading…
Cancel
Save