Files
taxbaik/src/TaxBaik.Web/Components/Admin/Services/LocalStorageService.cs
T
kjh2064 2762f74d1e
TaxBaik CI/CD / build-and-deploy (push) Failing after 59s
fix: update Service namespaces to match FastEndpoints structure
Fixed namespace mismatch:
- TaxBaik.Web.Services → TaxBaik.Web.Components.Admin.Services
- Browser Client services now properly discoverable
- _Imports.razor @using directives now resolve correctly

Build status:  0 errors, 68 warnings

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-03 15:41:35 +09:00

44 lines
939 B
C#

using Microsoft.JSInterop;
namespace TaxBaik.Web.Components.Admin.Services;
public class LocalStorageService : ILocalStorageService
{
private readonly IJSRuntime _jsRuntime;
public LocalStorageService(IJSRuntime jsRuntime)
{
_jsRuntime = jsRuntime;
}
public async Task<string?> GetItemAsStringAsync(string key)
{
try
{
return await _jsRuntime.InvokeAsync<string>("localStorage.getItem", key);
}
catch
{
return null;
}
}
public async Task SetItemAsStringAsync(string key, string value)
{
try
{
await _jsRuntime.InvokeVoidAsync("localStorage.setItem", key, value);
}
catch { }
}
public async Task RemoveItemAsync(string key)
{
try
{
await _jsRuntime.InvokeVoidAsync("localStorage.removeItem", key);
}
catch { }
}
}