1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-26 05:03:39 +00:00
This commit is contained in:
Matt Portune
2022-01-17 21:58:04 -05:00
parent 120fb70039
commit 65739489a7
43 changed files with 893 additions and 1068 deletions

View File

@@ -12,6 +12,7 @@ namespace Bit.App.Pages
private readonly LoginPageViewModel _vm;
private readonly AppOptions _appOptions;
private bool _appeared;
private bool _inputFocused;
public LoginPage(string email = null, AppOptions appOptions = null)
@@ -34,11 +35,6 @@ namespace Bit.App.Pages
{
ToolbarItems.RemoveAt(0);
}
if (_appOptions?.ShowAccountSwitcher ?? false)
{
ToolbarItems.Add(_accountAvatar);
ToolbarItems.Remove(_closeItem);
}
_email.ReturnType = ReturnType.Next;
_email.ReturnCommand = new Command(() => _masterPassword.Focus());
@@ -58,18 +54,24 @@ namespace Bit.App.Pages
protected override async void OnAppearing()
{
base.OnAppearing();
_mainContent.Content = _mainLayout;
if (_appOptions?.ShowAccountSwitcher ?? false)
{
_appOptions.ShowAccountSwitcher = false;
_vm.AvatarImageSource = await GetAvatarImageSourceAsync();
}
await _vm.InitAsync();
if (!_inputFocused)
{
RequestFocus(string.IsNullOrWhiteSpace(_vm.Email) ? _email : _masterPassword);
_inputFocused = true;
}
if (_appeared)
{
return;
}
_appeared = true;
_mainContent.Content = _mainLayout;
if (await HasMultipleAccountsAsync())
{
ToolbarItems.Add(_accountAvatar);
ToolbarItems.Remove(_closeItem);
_vm.AvatarImageSource = await GetAvatarImageSourceAsync();
}
}
private async void LogIn_Clicked(object sender, EventArgs e)