mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-21 10:27:18 +02:00
feat: http header passing mechanism
This commit is contained in:
1 parent
64ad05dc92
commit
05059b0eda
6 files changed
+71
-13
No files matched your search
@@ -19,6 +19,9 @@ namespace WotBlitzStatisticsPro.Blazor.Pages
|
||||
[Inject]
|
||||
public IStringLocalizer<App> Localize { get; set; }
|
||||
|
||||
[Inject]
|
||||
public INotificationsService Notifications { get; set; }
|
||||
|
||||
|
||||
[Parameter]
|
||||
public long AccountId { get; set; }
|
||||
@@ -35,13 +38,20 @@ namespace WotBlitzStatisticsPro.Blazor.Pages
|
||||
var settings = await LocalStorageService.ReadSettings();
|
||||
CurrentRealmType = settings.RealmType;
|
||||
|
||||
// Maybe add refresh button instead of calling mutation each time
|
||||
if(loggedInInfo != null && loggedInInfo.AccountId == AccountId)
|
||||
try
|
||||
{
|
||||
await GraphQlBackendService.CollectPlayerInfo(AccountId, CurrentRealmType, loggedInInfo.AccessToken);
|
||||
}
|
||||
// Maybe add refresh button instead of calling mutation each time
|
||||
if(loggedInInfo != null && loggedInInfo.AccountId == AccountId)
|
||||
{
|
||||
await GraphQlBackendService.CollectPlayerInfo(AccountId, CurrentRealmType, loggedInInfo.AccessToken);
|
||||
}
|
||||
|
||||
(AccountInfo, AchievementsBySection) = await GraphQlBackendService.GetPlayerInfo(AccountId, CurrentRealmType);
|
||||
(AccountInfo, AchievementsBySection) = await GraphQlBackendService.GetPlayerInfo(AccountId, CurrentRealmType);
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Notifications.ReportError("Can not get data from backend", e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user