mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 23:18:27 +02:00
fix: add cancel button for better UI flow (MESSENGER-7861)
This commit is contained in:
@@ -235,14 +235,17 @@ NSString *const kMXKWebViewViewControllerJavaScriptEnableLog =
|
||||
canGoBack = (![webView.URL.absoluteString isEqualToString:@"about:blank"]);
|
||||
}
|
||||
|
||||
if (canGoBack)
|
||||
{
|
||||
self.navigationItem.rightBarButtonItem = backButton;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Reset the original state
|
||||
self.navigationItem.rightBarButtonItems = originalRightBarButtonItems;
|
||||
// bwi #7861 don't overwrite other barbutton items here
|
||||
if (self.navigationItem.rightBarButtonItem == nil) {
|
||||
if (canGoBack)
|
||||
{
|
||||
self.navigationItem.rightBarButtonItem = backButton;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Reset the original state
|
||||
self.navigationItem.rightBarButtonItems = originalRightBarButtonItems;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,10 +53,16 @@ final class ReauthFallBackViewController: AuthFallBackViewController, Themable {
|
||||
}
|
||||
|
||||
private func setupNavigationBar() {
|
||||
// bwi #7861 change logic to both have a cancel and a close button. We don't need a back button here
|
||||
let doneBarButtonItem = MXKBarButtonItem(title: VectorL10n.close, style: .plain) { [weak self] in
|
||||
self?.didValidate?()
|
||||
}
|
||||
self.navigationItem.leftBarButtonItem = doneBarButtonItem
|
||||
self.navigationItem.rightBarButtonItem = doneBarButtonItem
|
||||
|
||||
let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in
|
||||
self?.didCancel?()
|
||||
}
|
||||
self.navigationItem.leftBarButtonItem = cancelBarButtonItem
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -149,6 +149,9 @@ final class ReauthenticationCoordinator: ReauthenticationCoordinatorType {
|
||||
return
|
||||
}
|
||||
self.delegate?.reauthenticationCoordinatorDidCancel(self)
|
||||
|
||||
// bwi #7861 cancel buttons should close the view
|
||||
self.presentingViewController.dismiss(animated: true)
|
||||
}
|
||||
|
||||
reauthFallbackViewController.didValidate = { [weak self] in
|
||||
|
||||
Reference in New Issue
Block a user