From fb61b228fadd064bb7442dce1f4c9443039ffd30 Mon Sep 17 00:00:00 2001 From: Dave Glover Date: Fri, 7 Jun 2024 18:05:39 +1000 Subject: [PATCH] ux handling for isLoading --- .../Components/Pages/EventMetrics.razor | 2 +- .../Components/Pages/EventMetrics.razor.cs | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/AzureOpenAIProxy.Management/Components/Pages/EventMetrics.razor b/src/AzureOpenAIProxy.Management/Components/Pages/EventMetrics.razor index 58f2da0d..51d20313 100644 --- a/src/AzureOpenAIProxy.Management/Components/Pages/EventMetrics.razor +++ b/src/AzureOpenAIProxy.Management/Components/Pages/EventMetrics.razor @@ -23,7 +23,7 @@ + Size="Size.Small" Style="width: 80px;" OnClick="RefreshData" Disabled="@IsLoading"/> diff --git a/src/AzureOpenAIProxy.Management/Components/Pages/EventMetrics.razor.cs b/src/AzureOpenAIProxy.Management/Components/Pages/EventMetrics.razor.cs index f05352a2..2f33b5a0 100644 --- a/src/AzureOpenAIProxy.Management/Components/Pages/EventMetrics.razor.cs +++ b/src/AzureOpenAIProxy.Management/Components/Pages/EventMetrics.razor.cs @@ -40,20 +40,15 @@ public partial class EventMetrics private async Task GetData() { - if (IsLoading) - { - return; - } - IsLoading = true; - (AttendeeCount, RequestCount) = MetricService.GetAttendeeMetricsAsync(EventId); List MetricsData = await MetricService.GetEventMetricsAsync(EventId); Event = await EventService.GetEventAsync(EventId); if (MetricsData is null) { + IsLoading = false; return; }