fix: handle dialog result for Caddy restart and ensure processing state is updated on failure
All checks were successful
Caddy Manager CI build / docker (push) Successful in 1m2s

This commit is contained in:
2025-07-17 08:35:30 +07:00
parent 209ff3fe9c
commit 2da42bc8bd

View File

@@ -74,7 +74,13 @@ public partial class CaddyReverseProxiesPage : ComponentBase
{ p => p.InitialContent, initialContent }
});
_ = await dialog.Result;
var result = await dialog.Result;
if (result is { Data: bool, Canceled: false } && (bool)result.Data)
{
await RestartCaddy();
}
Refresh();
}
@@ -175,6 +181,8 @@ public partial class CaddyReverseProxiesPage : ComponentBase
catch
{
Snackbar.Add("Failed to restart the Caddy container", Severity.Error);
_isProcessing = false;
StateHasChanged();
}
}