1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-17 08:43:21 +00:00

[EC-371] Fix iOS extensions login more menu (#2016)

* EC-371 fix iOS extensions login more menu and HintPage to display correctly on extensions

* EC-371 fix merge
This commit is contained in:
Federico Maccaroni
2022-08-08 11:28:48 -03:00
committed by GitHub
parent 570b56364a
commit 3ef5b576ac
13 changed files with 101 additions and 71 deletions

View File

@@ -451,7 +451,7 @@ namespace Bit.iOS.Extension
var homePage = new HomePage();
var app = new App.App(new AppOptions { IosExtension = true });
ThemeManager.SetTheme(app.Resources);
ThemeManager.ApplyResourcesToPage(homePage);
ThemeManager.ApplyResourcesTo(homePage);
if (homePage.BindingContext is HomeViewModel vm)
{
vm.StartLoginAction = () => DismissViewController(false, () => LaunchLoginFlow());
@@ -474,7 +474,7 @@ namespace Bit.iOS.Extension
var environmentPage = new EnvironmentPage();
var app = new App.App(new AppOptions { IosExtension = true });
ThemeManager.SetTheme(app.Resources);
ThemeManager.ApplyResourcesToPage(environmentPage);
ThemeManager.ApplyResourcesTo(environmentPage);
if (environmentPage.BindingContext is EnvironmentPageViewModel vm)
{
vm.SubmitSuccessAction = () => DismissViewController(false, () => LaunchHomePage());
@@ -492,7 +492,7 @@ namespace Bit.iOS.Extension
var registerPage = new RegisterPage(null);
var app = new App.App(new AppOptions { IosExtension = true });
ThemeManager.SetTheme(app.Resources);
ThemeManager.ApplyResourcesToPage(registerPage);
ThemeManager.ApplyResourcesTo(registerPage);
if (registerPage.BindingContext is RegisterPageViewModel vm)
{
vm.RegistrationSuccess = () => DismissViewController(false, () => LaunchLoginFlow(vm.Email));
@@ -507,10 +507,11 @@ namespace Bit.iOS.Extension
private void LaunchLoginFlow(string email = null)
{
var loginPage = new LoginPage(email);
var app = new App.App(new AppOptions { IosExtension = true });
var appOptions = new AppOptions { IosExtension = true };
var app = new App.App(appOptions);
var loginPage = new LoginPage(email, appOptions);
ThemeManager.SetTheme(app.Resources);
ThemeManager.ApplyResourcesToPage(loginPage);
ThemeManager.ApplyResourcesTo(loginPage);
if (loginPage.BindingContext is LoginPageViewModel vm)
{
vm.StartTwoFactorAction = () => DismissViewController(false, () => LaunchTwoFactorFlow(false));
@@ -532,7 +533,7 @@ namespace Bit.iOS.Extension
var loginPage = new LoginSsoPage();
var app = new App.App(new AppOptions { IosExtension = true });
ThemeManager.SetTheme(app.Resources);
ThemeManager.ApplyResourcesToPage(loginPage);
ThemeManager.ApplyResourcesTo(loginPage);
if (loginPage.BindingContext is LoginSsoPageViewModel vm)
{
vm.StartTwoFactorAction = () => DismissViewController(false, () => LaunchTwoFactorFlow(true));
@@ -555,7 +556,7 @@ namespace Bit.iOS.Extension
var twoFactorPage = new TwoFactorPage();
var app = new App.App(new AppOptions { IosExtension = true });
ThemeManager.SetTheme(app.Resources);
ThemeManager.ApplyResourcesToPage(twoFactorPage);
ThemeManager.ApplyResourcesTo(twoFactorPage);
if (twoFactorPage.BindingContext is TwoFactorPageViewModel vm)
{
vm.TwoFactorAuthSuccessAction = () => DismissLockAndContinue();
@@ -582,7 +583,7 @@ namespace Bit.iOS.Extension
var setPasswordPage = new SetPasswordPage();
var app = new App.App(new AppOptions { IosExtension = true });
ThemeManager.SetTheme(app.Resources);
ThemeManager.ApplyResourcesToPage(setPasswordPage);
ThemeManager.ApplyResourcesTo(setPasswordPage);
if (setPasswordPage.BindingContext is SetPasswordPageViewModel vm)
{
vm.UpdateTempPasswordAction = () => DismissViewController(false, () => LaunchUpdateTempPasswordFlow());
@@ -601,7 +602,7 @@ namespace Bit.iOS.Extension
var updateTempPasswordPage = new UpdateTempPasswordPage();
var app = new App.App(new AppOptions { IosExtension = true });
ThemeManager.SetTheme(app.Resources);
ThemeManager.ApplyResourcesToPage(updateTempPasswordPage);
ThemeManager.ApplyResourcesTo(updateTempPasswordPage);
if (updateTempPasswordPage.BindingContext is UpdateTempPasswordPageViewModel vm)
{
vm.UpdateTempPasswordSuccessAction = () => DismissViewController(false, () => LaunchHomePage());