Files
WotBlitzStatisticsBlazor/WotBlitzStatisticsPro.Blazor/Pages/PlayerInfoLayoutBase.cs
T

37 lines
1.1 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using System.Threading.Tasks;
2021-05-28 15:27:36 +02:00
using Microsoft.AspNetCore.Components;
using WotBlitzStatisticsPro.Blazor.GraphQl;
using WotBlitzStatisticsPro.Blazor.Services;
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; }
[Parameter]
public long AccountId { get; set; }
2021-05-28 15:27:36 +02:00
public RealmType CurrentRealmType { get; set; } = RealmType.Eu;
2021-06-04 15:35:53 +02:00
public IAccount AccountInfo { get; set; }
2021-05-28 15:27:36 +02:00
2021-06-04 15:35:53 +02:00
public IReadOnlyList<ISection> AchievementsBySection { get; set; }
2021-05-28 15:27:36 +02:00
protected override async Task OnInitializedAsync()
{
var settings = await LocalStorageService.ReadSettings();
CurrentRealmType = settings.RealmType;
(AccountInfo, AchievementsBySection) = await GraphQlBackendService.GetPlayerInfo(AccountId, CurrentRealmType);
2021-05-28 15:27:36 +02:00
await base.OnInitializedAsync();
}
}
}