2021-05-28 15:27:36 +02:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
using WotBlitzStatisticsPro.Blazor.GraphQl;
|
|
|
|
|
using WotBlitzStatisticsPro.Blazor.Services;
|
2021-04-06 18:17:22 +02:00
|
|
|
|
|
|
|
|
namespace WotBlitzStatisticsPro.Blazor.Pages
|
|
|
|
|
{
|
|
|
|
|
public class PlayerInfoLayoutBase: ComponentBase
|
|
|
|
|
{
|
2021-05-28 15:27:36 +02:00
|
|
|
[Inject]
|
|
|
|
|
public IGraphQlBackendService GraphQlBackendService { get; set; }
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public ILocalStorageService LocalStorageService { get; set; }
|
|
|
|
|
|
2021-04-06 18:17:22 +02:00
|
|
|
[Parameter]
|
|
|
|
|
public long AccountId { get; set; }
|
|
|
|
|
|
2021-05-28 15:27:36 +02:00
|
|
|
public RealmType CurrentRealmType { get; set; } = RealmType.Eu;
|
|
|
|
|
|
|
|
|
|
public IPlayer_AccountInfo AccountInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
|
{
|
|
|
|
|
var settings = await LocalStorageService.ReadSettings();
|
|
|
|
|
CurrentRealmType = settings.RealmType;
|
|
|
|
|
|
|
|
|
|
AccountInfo = await GraphQlBackendService.GetPlayerInfo(AccountId, CurrentRealmType);
|
|
|
|
|
|
|
|
|
|
await base.OnInitializedAsync();
|
|
|
|
|
|
|
|
|
|
}
|
2021-04-06 18:17:22 +02:00
|
|
|
}
|
|
|
|
|
}
|