We are confidence enough that the data will be saved to the db, so lets change how we update the UI, so instead of wating on the db call to complete, we will just update the UI while the db call is in progress

This commit is contained in:
TheXamlGuy
2024-05-22 20:13:50 +01:00
parent 0d7cb192d5
commit 9c8c7bf889
9 changed files with 46 additions and 55 deletions
+1 -1
View File
@@ -4,7 +4,6 @@ using Toolkit.Foundation;
namespace Bitvault;
public class ModifiedItemHandler(IServiceProvider serviceProvider,
ICache<Item> cache,
IPublisher publisher) :
INotificationHandler<ModifiedEventArgs<Item>>
{
@@ -13,6 +12,7 @@ public class ModifiedItemHandler(IServiceProvider serviceProvider,
Item oldItem = args.OldView;
Item newItem = args.NewValue;
ICache<Item> cache = serviceProvider.GetRequiredService<ICache<Item>>();
if (cache.TryGetValue(oldItem, out Item? cachedItem))
{
if (cachedItem is not null)