Skip to content

Commit

Permalink
fix: 修復在旁觀者按下元素會產生的錯誤
Browse files Browse the repository at this point in the history
  • Loading branch information
aa89227 committed Jun 13, 2024
1 parent 7b4ccc4 commit acca84d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Clients/Monopoly.Clients.Web/Pages/Ready/ReadyPage.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,28 @@ await Popup.Show(new Popup.PopupParameter

private async Task OnSelectColor(ColorEnum color)
{
if (CurrentPlayer is null)
{
return;
}
await Connection.SelectLocation(color.ToLocationEnum());
}

private async Task OnSelectRole(string role)
{
if (CurrentPlayer is null)
{
return;
}
await Connection.SelectRole(role);
}

private async Task OnReady()
{
if (CurrentPlayer is null)
{
return;
}
await Connection.PlayerReady();
}

Expand Down
2 changes: 1 addition & 1 deletion Clients/Monopoly.Clients.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

builder.Services.AddOptions<MonopolyApiOptions>()
.Configure(options => { builder.Configuration.GetSection(nameof(MonopolyApiOptions)).Bind(options); });
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

// Register the MonopolyApiClient
builder.Services.AddHttpClient<MonopolyDevelopmentApiClient>(client =>
Expand Down

0 comments on commit acca84d

Please sign in to comment.