fix(ui/admin): always clear _loading in DataConnectionForm.OnInitializedAsync

This commit is contained in:
Joseph Doherty
2026-05-12 01:14:18 -04:00
parent 9916aeaa47
commit cfb90d2078

View File

@@ -120,12 +120,12 @@
private string? _formError;
protected override async Task OnInitializedAsync()
{
try
{
_sites = (await SiteRepository.GetAllSitesAsync()).ToList();
if (Id.HasValue)
{
try
{
_editingConnection = await SiteRepository.GetDataConnectionByIdAsync(Id.Value);
if (_editingConnection != null)
@@ -147,11 +147,6 @@
}
}
}
catch (Exception ex)
{
_formError = $"Failed to load connection: {ex.Message}";
}
}
else if (SiteId.HasValue)
{
var site = _sites.FirstOrDefault(s => s.Id == SiteId.Value);
@@ -162,9 +157,16 @@
_siteLocked = true;
}
}
}
catch (Exception ex)
{
_formError = $"Failed to load: {ex.Message}";
}
finally
{
_loading = false;
}
}
private async Task SaveConnection()
{