Skip to content

Commit 8a513bb

Browse files
committed
Fix R07: clear activePasswordPrompts and display terminal error alert on capture failure/mismatch instead of looping back to show() which trapped the UI in single-flight lock.
1 parent 30c87de commit 8a513bb

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎submodules/ChatListUI/Sources/ArchiveLockHelpers.swift‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,14 +615,21 @@ private func presentArchivePasswordAlert(
615615
if confirmValue == trimmed {
616616
if capturePassword(trimmed) {
617617
wrappedOnSuccess()
618-
} else {
619618
Queue.mainQueue().after(0.3) {
620-
show(messageOverride: ArchiveLockLocalizedString.storageError)
619+
let errorAlert = UIAlertController(title: title, message: ArchiveLockLocalizedString.storageError, preferredStyle: .alert)
620+
errorAlert.addAction(UIAlertAction(title: strings.Common_OK, style: .cancel, handler: { _ in
621+
wrappedOnCancel()
622+
}))
623+
presentUIAlert(context: context, alert: errorAlert, onUnavailableHost: wrappedOnCancel)
621624
}
622625
}
623626
} else {
624627
Queue.mainQueue().after(0.3) {
625-
show(messageOverride: ArchiveLockLocalizedString.passwordsDoNotMatch)
628+
let errorAlert = UIAlertController(title: title, message: ArchiveLockLocalizedString.passwordsDoNotMatch, preferredStyle: .alert)
629+
errorAlert.addAction(UIAlertAction(title: strings.Common_OK, style: .cancel, handler: { _ in
630+
wrappedOnCancel()
631+
}))
632+
presentUIAlert(context: context, alert: errorAlert, onUnavailableHost: wrappedOnCancel)
626633
}
627634
}
628635
}))

0 commit comments

Comments
 (0)