protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    {
        _ = request ?? throw new ArgumentNullException(nameof(request));

        if (request.Headers.Contains(Constants.MapStatusHeaderName))
        {
            request.Headers.Remove(Constants.MapStatusHeaderName);
            request.Headers.Add(Constants.MapStatusHeaderName, (await _userSettingsService.GetAsync()).AllMaps.ToString());
        }

        return await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
    }
Exemple #2
0
 public async Task ChangeMapStatusAsync(bool allMaps)
 {
     AllMaps = allMaps;
     await UserSettingsService.SaveAsync(await UserSettingsService.GetAsync() with {
         AllMaps = AllMaps
     }, nameof(UserSettings.AllMaps));
Exemple #3
0
 protected override async Task OnInitializedAsync()
 {
     AllMaps = (await UserSettingsService.GetAsync()).AllMaps;
     Theme   = (await UserSettingsService.GetAsync()).Theme;
 }
 protected override async Task OnInitializedAsync()
 {
     Theme     = (await UserSettingsService.GetAsync()).Theme;
     _jsModule = await JSRuntime.InvokeAsync <IJSObjectReference>("import", $"./Layouts/Main/{nameof(SiteHeader)}.razor.js");
     await UpdateStyleAsync();
 }