Skip to content

Commit

Permalink
Add default UserID for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
GillesTourreau committed Jun 6, 2024
1 parent 70048cd commit 9bca679
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/Communication.UI.Blazor.Demo/Pages/Home.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace PosInformatique.Azure.Communication.UI.Blazor.Demo.Pages
{
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;

public partial class Home
{
Expand Down Expand Up @@ -52,6 +52,9 @@ public Home()
this.log = [];
}

[Inject]
public IConfiguration Configuration { get; set; } = default!;

public bool DisableLoad
{
get
Expand Down Expand Up @@ -82,6 +85,14 @@ public async ValueTask DisposeAsync()
GC.SuppressFinalize(this);
}

protected override void OnInitialized()
{
if (!string.IsNullOrWhiteSpace(this.Configuration["DEBUG_DEFAULT_USERID"]))
{
this.userId = this.Configuration["DEBUG_DEFAULT_USERID"]!;
}
}

private async Task CreateUserAsync()
{
this.userId = await this.IdentityManager.CreateUserAsync();
Expand Down

0 comments on commit 9bca679

Please sign in to comment.