From 01e984ceb083b504609317eeb0a4612c10623350 Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Sun, 3 Jul 2022 22:35:23 +0200 Subject: [PATCH] Add Toolbelt.Blazor.LoadingBar #900 (#901) --- .../Client/AzureIoTHub.Portal.Client.csproj | 1 + src/AzureIoTHub.Portal/Client/Program.cs | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/AzureIoTHub.Portal/Client/AzureIoTHub.Portal.Client.csproj b/src/AzureIoTHub.Portal/Client/AzureIoTHub.Portal.Client.csproj index 89d75c3d9..d52b61350 100644 --- a/src/AzureIoTHub.Portal/Client/AzureIoTHub.Portal.Client.csproj +++ b/src/AzureIoTHub.Portal/Client/AzureIoTHub.Portal.Client.csproj @@ -49,6 +49,7 @@ + diff --git a/src/AzureIoTHub.Portal/Client/Program.cs b/src/AzureIoTHub.Portal/Client/Program.cs index 92d4d2d2b..926d16c13 100644 --- a/src/AzureIoTHub.Portal/Client/Program.cs +++ b/src/AzureIoTHub.Portal/Client/Program.cs @@ -19,6 +19,7 @@ namespace AzureIoTHub.Portal.Client using MudBlazor; using MudBlazor.Services; using Tewr.Blazor.FileReader; + using Toolbelt.Blazor.Extensions.DependencyInjection; public static class Program { @@ -29,10 +30,11 @@ public static async Task Main(string[] args) _ = builder.Services.AddTransient(); - _ = builder.Services.AddHttpClient("api", client => + _ = builder.Services.AddHttpClient("api", (sp, client) => { client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress); client.DefaultRequestHeaders.Add("X-Version", "1.0"); + _ = client.EnableIntercept(sp); }).AddHttpMessageHandler() .AddHttpMessageHandler(); @@ -59,6 +61,10 @@ public static async Task Main(string[] args) await ConfigureOidc(builder); await ConfigurePortalSettings(builder); + // Enable loading bar + builder.Services.AddLoadingBar(); + _ = builder.UseLoadingBar(); + await builder.Build().RunAsync(); }