diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs index 6660cb49b..7508f4a89 100644 --- a/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs +++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs @@ -6,7 +6,6 @@ using Bit.Core.Abstractions; using Bit.Core.Enums; using Bit.Core.Utilities; using System; -using System.Linq; using System.Threading.Tasks; using Xamarin.Forms; @@ -78,6 +77,10 @@ namespace Bit.App.Pages } else if(message.Command == "syncCompleted") { + if(!_vm.LoadedOnce) + { + return; + } await Task.Delay(500); Device.BeginInvokeOnMainThread(() => { @@ -92,8 +95,15 @@ namespace Bit.App.Pages { if(!_syncService.SyncInProgress) { - await Task.Delay(500); - await _vm.LoadAsync(); + try + { + await _vm.LoadAsync(); + } + catch(Exception e) when(e.Message.Contains("No key.")) + { + await Task.Delay(5000); + await _vm.LoadAsync(); + } } else { diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs index dd90bbe04..4900e874c 100644 --- a/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs +++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs @@ -126,6 +126,7 @@ namespace Bit.App.Pages public ExtendedObservableCollection GroupedItems { get; set; } public Command RefreshCommand { get; set; } public Command CipherOptionsCommand { get; set; } + public bool LoadedOnce { get; set; } public async Task LoadAsync() { @@ -134,6 +135,7 @@ namespace Bit.App.Pages return; } _doingLoad = true; + LoadedOnce = true; ShowNoData = false; Loading = true; ShowList = false;