Remove unused modals service and display.
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
||||
{
|
||||
request.SetBrowserRequestCredentials(BrowserRequestCredentials.Include);
|
||||
Console.WriteLine("cookie handler: {0}", request.RequestUri);
|
||||
return base.SendAsync(request, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,15 +13,14 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
public const string MsalClientName = "Msal";
|
||||
|
||||
private readonly JsonSerializerOptions serializerOptions;
|
||||
private readonly IHttpClientFactory clientFactory;
|
||||
private readonly AccountState accountState;
|
||||
private readonly HttpClient guestHttpClient;
|
||||
private readonly HttpClient msalHttpClient;
|
||||
|
||||
public ShogiApi(IHttpClientFactory clientFactory, AccountState accountState)
|
||||
{
|
||||
serializerOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web);
|
||||
this.clientFactory = clientFactory;
|
||||
Console.WriteLine("ShogiApi constructor");
|
||||
this.serializerOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web);
|
||||
this.accountState = accountState;
|
||||
this.guestHttpClient = clientFactory.CreateClient(GuestClientName);
|
||||
this.msalHttpClient = clientFactory.CreateClient(MsalClientName);
|
||||
@@ -68,6 +67,7 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
var httpClient = whichAccountPlatform == WhichAccountPlatform.Microsoft
|
||||
? this.msalHttpClient
|
||||
: this.guestHttpClient;
|
||||
|
||||
var response = await httpClient.GetAsync(RelativeUri("User/Token"));
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
@@ -82,7 +82,7 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
|
||||
public async Task Move(string sessionName, MovePieceCommand command)
|
||||
{
|
||||
await this.HttpClient.PatchAsync($"Sessions/{sessionName}/Move", JsonContent.Create(command));
|
||||
await this.HttpClient.PatchAsync(RelativeUri($"Sessions/{sessionName}/Move"), JsonContent.Create(command));
|
||||
}
|
||||
|
||||
public async Task<HttpStatusCode> PostSession(string name, bool isPrivate)
|
||||
|
||||
Reference in New Issue
Block a user