mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Revert "Add CoordinatorDelegateQueuable protocol used by view models to handle coordinator delegation in an operation queue."
This reverts commit e3de3f899b631c28fee398222a0a7fdc1cab5b76.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
final class KeyBackupSetupPassphraseViewModel: KeyBackupSetupPassphraseViewModelType, CoordinatorDelegateQueuable {
|
||||
final class KeyBackupSetupPassphraseViewModel: KeyBackupSetupPassphraseViewModelType {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -25,7 +25,7 @@ final class KeyBackupSetupPassphraseViewModel: KeyBackupSetupPassphraseViewModel
|
||||
private(set) var passphraseStrength: PasswordStrength = .tooGuessable
|
||||
private let passwordStrengthManager: PasswordStrengthManager
|
||||
private let keyBackup: MXKeyBackup
|
||||
let coordinatorDelegateQueue: OperationQueue
|
||||
private let coordinatorDelegateQueue: OperationQueue
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@@ -60,7 +60,11 @@ final class KeyBackupSetupPassphraseViewModel: KeyBackupSetupPassphraseViewModel
|
||||
init(keyBackup: MXKeyBackup) {
|
||||
self.passwordStrengthManager = PasswordStrengthManager()
|
||||
self.keyBackup = keyBackup
|
||||
self.coordinatorDelegateQueue = type(of: self).createCoordinatorDelegateQueue()
|
||||
|
||||
let coordinatorDelegateQueue = OperationQueue()
|
||||
coordinatorDelegateQueue.name = "KeyBackupSetupPassphraseViewModel.coordinatorDelegateQueue"
|
||||
coordinatorDelegateQueue.maxConcurrentOperationCount = 1
|
||||
self.coordinatorDelegateQueue = coordinatorDelegateQueue
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
@@ -82,7 +86,7 @@ final class KeyBackupSetupPassphraseViewModel: KeyBackupSetupPassphraseViewModel
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func setupPassphrase() {
|
||||
func setupPassphrase() {
|
||||
guard let passphrase = self.passphrase else {
|
||||
return
|
||||
}
|
||||
@@ -119,4 +123,16 @@ final class KeyBackupSetupPassphraseViewModel: KeyBackupSetupPassphraseViewModel
|
||||
}
|
||||
return self.passwordStrengthManager.passwordStrength(for: password)
|
||||
}
|
||||
|
||||
private func pauseCoordinatorOperations() {
|
||||
self.coordinatorDelegateQueue.isSuspended = true
|
||||
}
|
||||
|
||||
private func resumeCoordinatorOperations() {
|
||||
self.coordinatorDelegateQueue.isSuspended = false
|
||||
}
|
||||
|
||||
private func cancelCoordinatorOperations() {
|
||||
self.coordinatorDelegateQueue.cancelAllOperations()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user