Persist frontend theme preference

This commit is contained in:
2026-03-21 13:13:26 +01:00
parent 0b7cc846e7
commit 4f1ef770c7
8 changed files with 103 additions and 5 deletions

View File

@@ -0,0 +1,12 @@
using Microsoft.JSInterop;
namespace RolemasterDb.App.Frontend.AppState;
public sealed class BrowserStorageService(IJSRuntime jsRuntime)
{
public ValueTask<string?> GetItemAsync(string key) =>
jsRuntime.InvokeAsync<string?>("localStorage.getItem", key);
public ValueTask SetItemAsync(string key, string value) =>
jsRuntime.InvokeVoidAsync("localStorage.setItem", key, value);
}