diff --git a/src/App/App.xaml.cs b/src/App/App.xaml.cs index 4d44dc01c..a6fc61929 100644 --- a/src/App/App.xaml.cs +++ b/src/App/App.xaml.cs @@ -459,14 +459,7 @@ namespace Bit.App switch (navTarget) { case NavigationTarget.HomeLogin: - if (navParams is HomeNavigationParams homeParams) - { - Current.MainPage = new NavigationPage(new HomePage(Options, homeParams.ShouldCheckRememberEmail)); - } - else - { - Current.MainPage = new NavigationPage(new HomePage(Options)); - } + Current.MainPage = new NavigationPage(new HomePage(Options)); break; case NavigationTarget.Login: if (navParams is LoginNavigationParams loginParams) diff --git a/src/App/Pages/Accounts/HomePage.xaml.cs b/src/App/Pages/Accounts/HomePage.xaml.cs index e121820ef..cc5fdeccc 100644 --- a/src/App/Pages/Accounts/HomePage.xaml.cs +++ b/src/App/Pages/Accounts/HomePage.xaml.cs @@ -15,14 +15,13 @@ namespace Bit.App.Pages private readonly AppOptions _appOptions; private IBroadcasterService _broadcasterService; - public HomePage(AppOptions appOptions = null, bool shouldCheckRememberEmail = true) + public HomePage(AppOptions appOptions = null) { _broadcasterService = ServiceContainer.Resolve("broadcasterService"); _appOptions = appOptions; InitializeComponent(); _vm = BindingContext as HomeViewModel; _vm.Page = this; - _vm.ShouldCheckRememberEmail = shouldCheckRememberEmail; _vm.ShowCancelButton = _appOptions?.IosExtension ?? false; _vm.StartLoginAction = async () => await StartLoginAsync(); _vm.StartRegisterAction = () => Device.BeginInvokeOnMainThread(async () => await StartRegisterAsync()); @@ -71,8 +70,6 @@ namespace Bit.App.Pages }); } }); - - _vm.CheckNavigateLoginStep(); } protected override bool OnBackButtonPressed() diff --git a/src/App/Pages/Accounts/HomePageViewModel.cs b/src/App/Pages/Accounts/HomePageViewModel.cs index 26a4c334e..17286384e 100644 --- a/src/App/Pages/Accounts/HomePageViewModel.cs +++ b/src/App/Pages/Accounts/HomePageViewModel.cs @@ -73,8 +73,6 @@ namespace Bit.App.Pages public bool CanContinue => !string.IsNullOrEmpty(Email); - public bool ShouldCheckRememberEmail { get; set; } - public FormattedString CreateAccountText { get @@ -110,15 +108,6 @@ namespace Bit.App.Pages RememberEmail = !string.IsNullOrEmpty(Email); } - public void CheckNavigateLoginStep() - { - if (ShouldCheckRememberEmail && RememberEmail) - { - StartLoginAction(); - } - ShouldCheckRememberEmail = false; - } - public async Task ContinueToLoginStepAsync() { try diff --git a/src/App/Utilities/AccountManagement/AccountsManager.cs b/src/App/Utilities/AccountManagement/AccountsManager.cs index c87671073..c8cf16a38 100644 --- a/src/App/Utilities/AccountManagement/AccountsManager.cs +++ b/src/App/Utilities/AccountManagement/AccountsManager.cs @@ -109,11 +109,11 @@ namespace Bit.App.Utilities.AccountManagement var email = await _stateService.GetEmailAsync(); await _stateService.SetRememberedEmailAsync(email); - _accountsManagerHost.Navigate(NavigationTarget.HomeLogin, new HomeNavigationParams(true)); + _accountsManagerHost.Navigate(NavigationTarget.HomeLogin); } else { - _accountsManagerHost.Navigate(NavigationTarget.HomeLogin, new HomeNavigationParams(false)); + _accountsManagerHost.Navigate(NavigationTarget.HomeLogin); } } } @@ -190,7 +190,7 @@ namespace Bit.App.Utilities.AccountManagement await Device.InvokeOnMainThreadAsync(() => { Options.HideAccountSwitcher = false; - _accountsManagerHost.Navigate(NavigationTarget.HomeLogin, new HomeNavigationParams(false)); + _accountsManagerHost.Navigate(NavigationTarget.HomeLogin); }); } diff --git a/src/App/Utilities/AccountManagement/HomeNavigationParams.cs b/src/App/Utilities/AccountManagement/HomeNavigationParams.cs deleted file mode 100644 index 9bda9f227..000000000 --- a/src/App/Utilities/AccountManagement/HomeNavigationParams.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Bit.App.Abstractions; - -namespace Bit.App.Utilities.AccountManagement -{ - public class HomeNavigationParams : INavigationParams - { - public HomeNavigationParams(bool shouldCheckRememberEmail) - { - ShouldCheckRememberEmail = shouldCheckRememberEmail; - } - - public bool ShouldCheckRememberEmail { get; } - } -} diff --git a/src/iOS.Autofill/CredentialProviderViewController.cs b/src/iOS.Autofill/CredentialProviderViewController.cs index 921576bbd..374a28ab6 100644 --- a/src/iOS.Autofill/CredentialProviderViewController.cs +++ b/src/iOS.Autofill/CredentialProviderViewController.cs @@ -426,10 +426,10 @@ namespace Bit.iOS.Autofill } } - private void LaunchHomePage(bool shouldCheckRememberEmail = true) + private void LaunchHomePage() { var appOptions = new AppOptions { IosExtension = true }; - var homePage = new HomePage(appOptions, shouldCheckRememberEmail); + var homePage = new HomePage(appOptions); var app = new App.App(appOptions); ThemeManager.SetTheme(app.Resources); ThemeManager.ApplyResourcesTo(homePage); @@ -458,8 +458,8 @@ namespace Bit.iOS.Autofill ThemeManager.ApplyResourcesTo(environmentPage); if (environmentPage.BindingContext is EnvironmentPageViewModel vm) { - vm.SubmitSuccessAction = () => DismissViewController(false, () => LaunchHomePage(shouldCheckRememberEmail: false)); - vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage(shouldCheckRememberEmail: false)); + vm.SubmitSuccessAction = () => DismissViewController(false, () => LaunchHomePage()); + vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage()); } var navigationPage = new NavigationPage(environmentPage); @@ -477,7 +477,7 @@ namespace Bit.iOS.Autofill if (registerPage.BindingContext is RegisterPageViewModel vm) { vm.RegistrationSuccess = () => DismissViewController(false, () => LaunchLoginFlow(vm.Email)); - vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage(shouldCheckRememberEmail: false)); + vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage()); } var navigationPage = new NavigationPage(registerPage); @@ -500,7 +500,7 @@ namespace Bit.iOS.Autofill vm.StartSsoLoginAction = () => DismissViewController(false, () => LaunchLoginSsoFlow()); vm.LogInWithDeviceAction = () => DismissViewController(false, () => LaunchLoginWithDevice(email)); vm.LogInSuccessAction = () => DismissLockAndContinue(); - vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage(shouldCheckRememberEmail: false)); + vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage()); } var navigationPage = new NavigationPage(loginPage); @@ -629,14 +629,7 @@ namespace Bit.iOS.Autofill switch (navTarget) { case NavigationTarget.HomeLogin: - if (navParams is HomeNavigationParams homeParams) - { - DismissViewController(false, () => LaunchHomePage(homeParams.ShouldCheckRememberEmail)); - } - else - { - DismissViewController(false, () => LaunchHomePage()); - } + DismissViewController(false, () => LaunchHomePage()); break; case NavigationTarget.Login: if (navParams is LoginNavigationParams loginParams) diff --git a/src/iOS.Extension/LoadingViewController.cs b/src/iOS.Extension/LoadingViewController.cs index 80bc850ea..307bb1c54 100644 --- a/src/iOS.Extension/LoadingViewController.cs +++ b/src/iOS.Extension/LoadingViewController.cs @@ -447,10 +447,10 @@ namespace Bit.iOS.Extension }); } - private void LaunchHomePage(bool shouldCheckRememberEmail = true) + private void LaunchHomePage() { var appOptions = new AppOptions { IosExtension = true }; - var homePage = new HomePage(appOptions, shouldCheckRememberEmail); + var homePage = new HomePage(appOptions); var app = new App.App(appOptions); ThemeManager.SetTheme(app.Resources); ThemeManager.ApplyResourcesTo(homePage); @@ -479,8 +479,8 @@ namespace Bit.iOS.Extension ThemeManager.ApplyResourcesTo(environmentPage); if (environmentPage.BindingContext is EnvironmentPageViewModel vm) { - vm.SubmitSuccessAction = () => DismissViewController(false, () => LaunchHomePage(shouldCheckRememberEmail: false)); - vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage(shouldCheckRememberEmail: false)); + vm.SubmitSuccessAction = () => DismissViewController(false, () => LaunchHomePage()); + vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage()); } var navigationPage = new NavigationPage(environmentPage); @@ -498,7 +498,7 @@ namespace Bit.iOS.Extension if (registerPage.BindingContext is RegisterPageViewModel vm) { vm.RegistrationSuccess = () => DismissViewController(false, () => LaunchLoginFlow(vm.Email)); - vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage(shouldCheckRememberEmail: false)); + vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage()); } var navigationPage = new NavigationPage(registerPage); @@ -521,7 +521,7 @@ namespace Bit.iOS.Extension vm.StartSsoLoginAction = () => DismissViewController(false, () => LaunchLoginSsoFlow()); vm.LogInWithDeviceAction = () => DismissViewController(false, () => LaunchLoginWithDevice(email)); vm.LogInSuccessAction = () => DismissLockAndContinue(); - vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage(shouldCheckRememberEmail: false)); + vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage()); } var navigationPage = new NavigationPage(loginPage); diff --git a/src/iOS.ShareExtension/LoadingViewController.cs b/src/iOS.ShareExtension/LoadingViewController.cs index b6d8abed0..de1281558 100644 --- a/src/iOS.ShareExtension/LoadingViewController.cs +++ b/src/iOS.ShareExtension/LoadingViewController.cs @@ -287,9 +287,9 @@ namespace Bit.iOS.ShareExtension return _app; } - private void LaunchHomePage(bool shouldCheckRememberEmail = true) + private void LaunchHomePage() { - var homePage = new HomePage(_appOptions.Value, shouldCheckRememberEmail); + var homePage = new HomePage(_appOptions.Value); SetupAppAndApplyResources(homePage); if (homePage.BindingContext is HomeViewModel vm) { @@ -311,8 +311,8 @@ namespace Bit.iOS.ShareExtension ThemeManager.ApplyResourcesTo(environmentPage); if (environmentPage.BindingContext is EnvironmentPageViewModel vm) { - vm.SubmitSuccessAction = () => DismissAndLaunch(() => LaunchHomePage(shouldCheckRememberEmail: false)); - vm.CloseAction = () => DismissAndLaunch(() => LaunchHomePage(shouldCheckRememberEmail: false)); + vm.SubmitSuccessAction = () => DismissAndLaunch(() => LaunchHomePage()); + vm.CloseAction = () => DismissAndLaunch(() => LaunchHomePage()); } NavigateToPage(environmentPage); @@ -325,7 +325,7 @@ namespace Bit.iOS.ShareExtension if (registerPage.BindingContext is RegisterPageViewModel vm) { vm.RegistrationSuccess = () => DismissAndLaunch(() => LaunchLoginFlow(vm.Email)); - vm.CloseAction = () => DismissAndLaunch(() => LaunchHomePage(shouldCheckRememberEmail: false)); + vm.CloseAction = () => DismissAndLaunch(() => LaunchHomePage()); } NavigateToPage(registerPage); } @@ -341,7 +341,7 @@ namespace Bit.iOS.ShareExtension vm.StartSsoLoginAction = () => DismissAndLaunch(() => LaunchLoginSsoFlow()); vm.LogInWithDeviceAction = () => DismissAndLaunch(() => LaunchLoginWithDevice(email)); vm.LogInSuccessAction = () => { DismissLockAndContinue(); }; - vm.CloseAction = () => DismissAndLaunch(() => LaunchHomePage(shouldCheckRememberEmail: false)); + vm.CloseAction = () => DismissAndLaunch(() => LaunchHomePage()); } NavigateToPage(loginPage); @@ -441,14 +441,7 @@ namespace Bit.iOS.ShareExtension switch (navTarget) { case NavigationTarget.HomeLogin: - if (navParams is HomeNavigationParams homeParams) - { - ExecuteLaunch(() => LaunchHomePage(homeParams.ShouldCheckRememberEmail)); - } - else - { - ExecuteLaunch(() => LaunchHomePage()); - } + ExecuteLaunch(() => LaunchHomePage()); break; case NavigationTarget.Login: if (navParams is LoginNavigationParams loginParams)