Change how pages are loaded to prevent multi-load.

This commit is contained in:
2020-06-10 17:31:57 +01:00
parent 0ed1ea4301
commit df59f668d8
30 changed files with 239 additions and 41 deletions

View File

@@ -36,6 +36,7 @@ namespace Marechai.Pages.Admin
{
bool _deleteInProgress;
Modal _frmDelete;
bool _loaded;
ProcessorViewModel _processor;
List<ProcessorViewModel> _processors;
@@ -74,6 +75,14 @@ namespace Marechai.Pages.Admin
void ModalClosing(ModalClosingEventArgs obj) => _processor = null;
protected override async Task OnInitializedAsync() => _processors = await Service.GetAsync();
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if(_loaded)
return;
_processors = await Service.GetAsync();
_loaded = true;
StateHasChanged();
}
}
}