fix(ui/admin): always clear _loading in DataConnectionForm.OnInitializedAsync
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user