mirror of
https://github.com/bitwarden/mobile
synced 2025-12-19 17:53:47 +00:00
fix for stuck extension sheets when dismissed by swipe (#1117)
* fix for stuck extension sheets when dismissed by swipe * simplify dismiss action assignments
This commit is contained in:
@@ -18,6 +18,7 @@ using Xamarin.Forms;
|
||||
using Bit.App.Pages;
|
||||
using Bit.App.Models;
|
||||
using Bit.App.Utilities;
|
||||
using Bit.iOS.Core.Views;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
{
|
||||
@@ -94,20 +95,28 @@ namespace Bit.iOS.Extension
|
||||
{
|
||||
listLoginController.Context = _context;
|
||||
listLoginController.LoadingController = this;
|
||||
segue.DestinationViewController.PresentationController.Delegate =
|
||||
new CustomPresentationControllerDelegate(listLoginController.DismissModalAction);
|
||||
}
|
||||
else if (navController.TopViewController is LoginAddViewController addLoginController)
|
||||
{
|
||||
addLoginController.Context = _context;
|
||||
addLoginController.LoadingController = this;
|
||||
segue.DestinationViewController.PresentationController.Delegate =
|
||||
new CustomPresentationControllerDelegate(addLoginController.DismissModalAction);
|
||||
}
|
||||
else if (navController.TopViewController is LockPasswordViewController passwordViewController)
|
||||
{
|
||||
passwordViewController.LoadingController = this;
|
||||
segue.DestinationViewController.PresentationController.Delegate =
|
||||
new CustomPresentationControllerDelegate(passwordViewController.DismissModalAction);
|
||||
}
|
||||
else if (navController.TopViewController is SetupViewController setupViewController)
|
||||
{
|
||||
setupViewController.Context = _context;
|
||||
setupViewController.LoadingController = this;
|
||||
segue.DestinationViewController.PresentationController.Delegate =
|
||||
new CustomPresentationControllerDelegate(setupViewController.DismissModalAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace Bit.iOS.Extension
|
||||
: base(handle)
|
||||
{
|
||||
BiometricIntegrityKey = "extensionBiometricState";
|
||||
DismissModalAction = Cancel;
|
||||
}
|
||||
|
||||
public LoadingViewController LoadingController { get; set; }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Bit.iOS.Core.Utilities;
|
||||
using Bit.iOS.Core.Views;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
@@ -9,7 +10,9 @@ namespace Bit.iOS.Extension
|
||||
{
|
||||
public LoginAddViewController(IntPtr handle)
|
||||
: base(handle)
|
||||
{ }
|
||||
{
|
||||
DismissModalAction = Cancel;
|
||||
}
|
||||
|
||||
public LoginListViewController LoginListController { get; set; }
|
||||
public LoadingViewController LoadingController { get; set; }
|
||||
@@ -39,6 +42,11 @@ namespace Bit.iOS.Extension
|
||||
};
|
||||
|
||||
partial void CancelBarButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
Cancel();
|
||||
}
|
||||
|
||||
private void Cancel()
|
||||
{
|
||||
if (LoginListController != null)
|
||||
{
|
||||
@@ -63,6 +71,8 @@ namespace Bit.iOS.Extension
|
||||
{
|
||||
passwordGeneratorController.PasswordOptions = Context.PasswordOptions;
|
||||
passwordGeneratorController.Parent = this;
|
||||
segue.DestinationViewController.PresentationController.Delegate =
|
||||
new CustomPresentationControllerDelegate(passwordGeneratorController.DismissModalAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,9 @@ namespace Bit.iOS.Extension
|
||||
{
|
||||
public LoginListViewController(IntPtr handle)
|
||||
: base(handle)
|
||||
{ }
|
||||
{
|
||||
DismissModalAction = Cancel;
|
||||
}
|
||||
|
||||
public Context Context { get; set; }
|
||||
public LoadingViewController LoadingController { get; set; }
|
||||
@@ -56,6 +58,11 @@ namespace Bit.iOS.Extension
|
||||
}
|
||||
|
||||
partial void CancelBarButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
Cancel();
|
||||
}
|
||||
|
||||
private void Cancel()
|
||||
{
|
||||
LoadingController.CompleteRequest(null, null);
|
||||
}
|
||||
@@ -73,6 +80,8 @@ namespace Bit.iOS.Extension
|
||||
{
|
||||
addLoginController.Context = Context;
|
||||
addLoginController.LoginListController = this;
|
||||
segue.DestinationViewController.PresentationController.Delegate =
|
||||
new CustomPresentationControllerDelegate(addLoginController.DismissModalAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ namespace Bit.iOS.Extension
|
||||
{
|
||||
public PasswordGeneratorViewController(IntPtr handle)
|
||||
: base(handle)
|
||||
{ }
|
||||
{
|
||||
DismissModalAction = Cancel;
|
||||
}
|
||||
|
||||
public LoginAddViewController Parent { get; set; }
|
||||
public override UINavigationItem BaseNavItem => NavItem;
|
||||
@@ -29,6 +31,11 @@ namespace Bit.iOS.Extension
|
||||
}
|
||||
|
||||
partial void CancelBarButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
Cancel();
|
||||
}
|
||||
|
||||
private void Cancel()
|
||||
{
|
||||
DismissViewController(true, null);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace Bit.iOS.Extension
|
||||
: base(handle)
|
||||
{
|
||||
ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
|
||||
DismissModalAction = Cancel;
|
||||
}
|
||||
|
||||
public Context Context { get; set; }
|
||||
@@ -37,6 +38,11 @@ namespace Bit.iOS.Extension
|
||||
}
|
||||
|
||||
partial void BackButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
Cancel();
|
||||
}
|
||||
|
||||
private void Cancel()
|
||||
{
|
||||
LoadingController.CompleteRequest(null, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user