1
0
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:
Matt Portune
2020-10-15 14:34:31 -04:00
committed by GitHub
parent 523e713d7a
commit b163a0fe77
17 changed files with 131 additions and 8 deletions

View File

@@ -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);
}
}
}

View File

@@ -10,6 +10,7 @@ namespace Bit.iOS.Extension
: base(handle)
{
BiometricIntegrityKey = "extensionBiometricState";
DismissModalAction = Cancel;
}
public LoadingViewController LoadingController { get; set; }

View File

@@ -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);
}
}
}

View File

@@ -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);
}
}
}

View File

@@ -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);
}

View File

@@ -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);
}