diff --git a/src/App/Pages/Accounts/BaseChangePasswordViewModel.cs b/src/App/Pages/Accounts/BaseChangePasswordViewModel.cs index f5dae6ee6..b8ed2a230 100644 --- a/src/App/Pages/Accounts/BaseChangePasswordViewModel.cs +++ b/src/App/Pages/Accounts/BaseChangePasswordViewModel.cs @@ -21,6 +21,7 @@ namespace Bit.App.Pages protected readonly ICryptoService _cryptoService; protected readonly IDeviceActionService _deviceActionService; protected readonly IApiService _apiService; + protected readonly ISyncService _syncService; private bool _showPassword; private bool _isPolicyInEffect; @@ -38,6 +39,7 @@ namespace Bit.App.Pages _cryptoService = ServiceContainer.Resolve("cryptoService"); _deviceActionService = ServiceContainer.Resolve("deviceActionService"); _apiService = ServiceContainer.Resolve("apiService"); + _syncService = ServiceContainer.Resolve("syncService"); } public bool ShowPassword @@ -70,9 +72,17 @@ namespace Bit.App.Pages public string ConfirmMasterPassword { get; set; } public string Hint { get; set; } - public async Task InitAsync() + public async Task InitAsync(bool forceSync = false) { - await CheckPasswordPolicy(); + if (forceSync) + { + var task = Task.Run(async () => await _syncService.FullSyncAsync(true)); + await task.ContinueWith(async (t) => await CheckPasswordPolicy()); + } + else + { + await CheckPasswordPolicy(); + } } private async Task CheckPasswordPolicy() diff --git a/src/App/Pages/Accounts/UpdateTempPasswordPage.xaml b/src/App/Pages/Accounts/UpdateTempPasswordPage.xaml index a9fefa6a4..b9fd0e8ee 100644 --- a/src/App/Pages/Accounts/UpdateTempPasswordPage.xaml +++ b/src/App/Pages/Accounts/UpdateTempPasswordPage.xaml @@ -25,7 +25,9 @@ - + diff --git a/src/App/Pages/Accounts/UpdateTempPasswordPage.xaml.cs b/src/App/Pages/Accounts/UpdateTempPasswordPage.xaml.cs index ae2ee4787..3a2876b09 100644 --- a/src/App/Pages/Accounts/UpdateTempPasswordPage.xaml.cs +++ b/src/App/Pages/Accounts/UpdateTempPasswordPage.xaml.cs @@ -11,6 +11,7 @@ namespace Bit.App.Pages private readonly IMessagingService _messagingService; private readonly IPlatformUtilsService _platformUtilsService; private readonly UpdateTempPasswordPageViewModel _vm; + private readonly string _pageName; public UpdateTempPasswordPage() { @@ -23,8 +24,10 @@ namespace Bit.App.Pages // Binding InitializeComponent(); + _pageName = string.Concat(nameof(UpdateTempPasswordPage), "_", DateTime.UtcNow.Ticks); _vm = BindingContext as UpdateTempPasswordPageViewModel; _vm.Page = this; + SetActivityIndicator(); // Actions Declaration _vm.LogOutAction = () => @@ -50,7 +53,10 @@ namespace Bit.App.Pages protected override async void OnAppearing() { base.OnAppearing(); - await _vm.InitAsync(); + await LoadOnAppearedAsync(_mainLayout, true, async () => + { + await _vm.InitAsync(true); + }); RequestFocus(_masterPassword); }