1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-29 12:45:20 +01:00

ac-1425 added main thread invocations when updating the vault properties to fix cases where the screen stays blank and doesn't update (#2604)

This commit is contained in:
Federico Maccaroni 2023-07-17 16:53:30 -03:00 committed by GitHub
parent 6d7970f767
commit cd9e49b13b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -330,6 +330,8 @@ namespace Bit.App.Pages
items.AddRange(itemGroup);
}
Device.BeginInvokeOnMainThread(() =>
{
if (Device.RuntimePlatform == Device.iOS)
{
// HACK: [PS-536] Fix to avoid blank list after back navigation on unlocking with previous page info
@ -337,6 +339,7 @@ namespace Bit.App.Pages
GroupedItems.Clear();
}
GroupedItems.ReplaceRange(items);
});
}
else
{
@ -356,6 +359,8 @@ namespace Bit.App.Pages
items.AddRange(itemGroup);
}
Device.BeginInvokeOnMainThread(() =>
{
if (groupedItems.Any())
{
if (Device.RuntimePlatform == Device.iOS)
@ -371,6 +376,7 @@ namespace Bit.App.Pages
{
GroupedItems.Clear();
}
});
}
}
finally
@ -378,9 +384,12 @@ namespace Bit.App.Pages
_doingLoad = false;
Loaded = true;
Loading = false;
Device.BeginInvokeOnMainThread(() =>
{
ShowNoData = (MainPage && !HasCiphers) || !groupedItems.Any();
ShowList = !ShowNoData;
DisableRefreshing();
});
}
}