fix(adminui): stale-open guards, validation summaries, key-delete confirm, error boundary (#604)
Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
@@ -80,11 +80,20 @@
|
||||
private string? _error;
|
||||
private bool _wasVisible;
|
||||
|
||||
// Bumped on every open and close so a superseded picker-root load can't install its tree under a
|
||||
// different equipment's (or a re-opened) modal (RawBrowseModal idiom).
|
||||
private int _openGeneration;
|
||||
|
||||
private bool IsStale(int generation) => generation != _openGeneration || !Visible;
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
// Reset + reload only on the false→true transition so re-renders while open don't wipe state.
|
||||
if (!Visible && _wasVisible) { _openGeneration++; }
|
||||
if (Visible && !_wasVisible)
|
||||
{
|
||||
_wasVisible = true;
|
||||
var generation = ++_openGeneration;
|
||||
_selected.Clear();
|
||||
_error = null;
|
||||
_roots = Array.Empty<RawNode>();
|
||||
@@ -94,6 +103,7 @@
|
||||
var root = string.IsNullOrEmpty(EquipmentId)
|
||||
? null
|
||||
: await Svc.LoadReferencePickerRootAsync(EquipmentId);
|
||||
if (IsStale(generation)) { return; }
|
||||
_roots = root is null ? Array.Empty<RawNode>() : new[] { root };
|
||||
_loading = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user