diff --git a/src/Money.UI.Blazor/Services/CategoryMiddleware.cs b/src/Money.UI.Blazor/Services/CategoryMiddleware.cs index 3d6ff006..14a80127 100644 --- a/src/Money.UI.Blazor/Services/CategoryMiddleware.cs +++ b/src/Money.UI.Blazor/Services/CategoryMiddleware.cs @@ -29,10 +29,9 @@ public async Task ExecuteAsync(object query, HttpQueryDispatcher dispatc if (models.Count == 0) { if (listAllTask == null) - listAllTask = LoadAllAsync(listAll, next); + listAllTask = LoadAllAsync(listAll, next).ContinueWith(t => listAllTask = null); await listAllTask; - listAllTask = null; } return models.Select(c => c.Clone()).ToList(); diff --git a/src/Money.UI.Blazor/Services/CurrencyMiddleware.cs b/src/Money.UI.Blazor/Services/CurrencyMiddleware.cs index 2d4924e4..90e80bc6 100644 --- a/src/Money.UI.Blazor/Services/CurrencyMiddleware.cs +++ b/src/Money.UI.Blazor/Services/CurrencyMiddleware.cs @@ -28,10 +28,9 @@ public async Task ExecuteAsync(object query, HttpQueryDispatcher dispatc if (models.Count == 0) { if (listAllTask == null) - listAllTask = LoadAllAsync(listAll, next); + listAllTask = LoadAllAsync(listAll, next).ContinueWith(t => listAllTask = null); await listAllTask; - listAllTask = null; } return models.Select(c => c.Clone()).ToList(); diff --git a/src/Money.UI.Blazor/Services/UserMiddleware.cs b/src/Money.UI.Blazor/Services/UserMiddleware.cs index cd63226e..cea3e8b6 100644 --- a/src/Money.UI.Blazor/Services/UserMiddleware.cs +++ b/src/Money.UI.Blazor/Services/UserMiddleware.cs @@ -24,10 +24,9 @@ public async Task ExecuteAsync(object query, HttpQueryDispatcher dispatc if (profile == null) { if (getProfileTask == null) - getProfileTask = LoadProfileAsync(getProfile, next); + getProfileTask = LoadProfileAsync(getProfile, next).ContinueWith(t => getProfileTask = null); await getProfileTask; - getProfileTask = null; } return profile;