Skip to content

Commit

Permalink
Add Toolbelt.Blazor.LoadingBar #900 (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
hocinehacherouf authored Jul 3, 2022
1 parent bbbc9c6 commit 01e984c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" />
<PackageReference Include="Tewr.Blazor.FileReader" Version="3.3.1.21360" />
<PackageReference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" Version="3.2.0-rc1.20223.4" />
<PackageReference Include="Toolbelt.Blazor.LoadingBar" Version="13.1.2" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 7 additions & 1 deletion src/AzureIoTHub.Portal/Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -29,10 +30,11 @@ public static async Task Main(string[] args)

_ = builder.Services.AddTransient<ProblemDetailsHandler>();

_ = 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<BaseAddressAuthorizationMessageHandler>()
.AddHttpMessageHandler<ProblemDetailsHandler>();

Expand All @@ -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();
}

Expand Down

0 comments on commit 01e984c

Please sign in to comment.