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); }
public async Task ChangeMapStatusAsync(bool allMaps) { AllMaps = allMaps; await UserSettingsService.SaveAsync(await UserSettingsService.GetAsync() with { AllMaps = AllMaps }, nameof(UserSettings.AllMaps));
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(); }