mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 03:20:50 +02:00
MESSENGER-4951 Changed password confirmation
This commit is contained in:
@@ -49,19 +49,25 @@ class ChangePasswordViewModel: ChangePasswordViewModelType, ChangePasswordViewMo
|
||||
switch viewAction {
|
||||
case .submit:
|
||||
guard state.bindings.newPassword1 == state.bindings.newPassword2 else {
|
||||
Task { await displayError(.passwordsDontMatch) }
|
||||
Task { await displayError(.passwordsDontMatch, primaryButtonCallback: {}) }
|
||||
return
|
||||
}
|
||||
Task { await callback?(.submit(oldPassword: state.bindings.oldPassword,
|
||||
newPassword: state.bindings.newPassword1,
|
||||
signoutAllDevices: state.bindings.signoutAllDevices)) }
|
||||
signoutAllDevices: state.bindings.signoutAllDevices))
|
||||
}
|
||||
case .toggleSignoutAllDevices:
|
||||
state.bindings.signoutAllDevices.toggle()
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor func displayError(_ type: ChangePasswordErrorType) {
|
||||
@MainActor func displayError(_ type: ChangePasswordErrorType, primaryButtonCallback: @escaping (() -> Void)) {
|
||||
switch type {
|
||||
case .passwordChangeSucceeded:
|
||||
state.bindings.alertInfo = AlertInfo(id: .passwordChangeSucceeded,
|
||||
title: BWIL10n.settingsPasswordChanged,
|
||||
message: "",
|
||||
primaryButton: (VectorL10n.ok, action: { primaryButtonCallback() }))
|
||||
case .mxError(let message):
|
||||
state.bindings.alertInfo = AlertInfo(id: type,
|
||||
title: VectorL10n.error,
|
||||
|
||||
Reference in New Issue
Block a user