mirror of
https://github.com/bitwarden/mobile
synced 2025-12-15 07:43:37 +00:00
android back on main pages goes to vault first
This commit is contained in:
@@ -18,6 +18,7 @@ namespace Bit.App.Pages
|
||||
private readonly IGoogleAnalyticsService _googleAnalyticsService;
|
||||
private readonly Action<string> _passwordValueAction;
|
||||
private readonly bool _fromAutofill;
|
||||
private readonly MainPage _mainPage;
|
||||
|
||||
public ToolsPasswordGeneratorPage(Action<string> passwordValueAction = null, bool fromAutofill = false)
|
||||
{
|
||||
@@ -31,6 +32,12 @@ namespace Bit.App.Pages
|
||||
Init();
|
||||
}
|
||||
|
||||
public ToolsPasswordGeneratorPage(MainPage mainPage)
|
||||
: this()
|
||||
{
|
||||
_mainPage = mainPage;
|
||||
}
|
||||
|
||||
public PasswordGeneratorPageModel Model { get; private set; } = new PasswordGeneratorPageModel();
|
||||
public Label Password { get; private set; }
|
||||
public SliderViewCell SliderCell { get; private set; }
|
||||
@@ -253,6 +260,17 @@ namespace Bit.App.Pages
|
||||
SliderCell.Dispose();
|
||||
}
|
||||
|
||||
protected override bool OnBackButtonPressed()
|
||||
{
|
||||
if(Device.RuntimePlatform == Device.Android && _mainPage != null)
|
||||
{
|
||||
_mainPage.ResetToVaultPage();
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnBackButtonPressed();
|
||||
}
|
||||
|
||||
private void RegenerateCell_Tapped(object sender, EventArgs e)
|
||||
{
|
||||
Model.Password = _passwordGenerationService.GeneratePassword();
|
||||
|
||||
Reference in New Issue
Block a user