using Microsoft.AspNetCore.Components; using SMGen.Data.Services; using StackExchange.Redis; namespace SMGen.Pages { public partial class ForceReset { [Inject] protected SMGDataService SMGDService { get; set; } = null!; [Inject] protected NavigationManager NavMan { get; set; } = null!; //protected override Task OnParametersSetAsync() //{ // return base.OnParametersSetAsync(); //} protected override async Task OnInitializedAsync() { isResetting = true; RedisValue currKey = new RedisValue($"{Core.Constants.redisBaseAddr}:*"); await SMGDService.ExecFlushRedisPattern(currKey); await Task.Delay(500); isResetting = false; NavMan.NavigateTo("", true); } private bool isResetting = false; } }