Files
GPW/GPW.CORE.UI/Components/ForceReset.razor
T
2022-01-05 09:08:08 +01:00

38 lines
760 B
Plaintext

@page "/ForceReset"
@using CORE.Data.DbModels
@using UI.Data
@inject GpwDataService GDataServ
@inject NavigationManager NavManager
@inject MessageService AppMServ
<div class="card">
<div class="card-header">
<h1>@message</h1>
</div>
<div class="card-body">
<LoadingData></LoadingData>
</div>
</div>
@code {
protected string message = "Resetting Cache!";
protected override async Task OnInitializedAsync()
{
await GDataServ.InvalidateAllCache();
message = "Reset done!";
AppMServ.clonedRA = null;
AppMServ.recordRA = null;
AppMServ.RigaDip = null;
// attendo 100 msec
await Task.Delay(100);
// passo a pagina home
NavManager.NavigateTo("/");
}
}