fix(ui): improve config save UX (#1678)
Follow-up to #1609 fix: - Remove formUnsafe check from canSave (was blocking save even with valid changes) - Suppress disconnect message for code 1012 (service restart is expected during config save) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -134,7 +134,10 @@ export function connectGateway(host: GatewayHost) {
|
||||
},
|
||||
onClose: ({ code, reason }) => {
|
||||
host.connected = false;
|
||||
host.lastError = `disconnected (${code}): ${reason || "no reason"}`;
|
||||
// Code 1012 = Service Restart (expected during config saves, don't show as error)
|
||||
if (code !== 1012) {
|
||||
host.lastError = `disconnected (${code}): ${reason || "no reason"}`;
|
||||
}
|
||||
},
|
||||
onEvent: (evt) => handleGatewayEvent(host, evt),
|
||||
onGap: ({ expected, received }) => {
|
||||
|
||||
@@ -234,8 +234,9 @@ export function renderConfig(props: ConfigProps) {
|
||||
const hasChanges = props.formMode === "form" ? diff.length > 0 : hasRawChanges;
|
||||
|
||||
// Save/apply buttons require actual changes to be enabled
|
||||
// Note: formUnsafe warns about unsupported schema paths but shouldn't block saving
|
||||
const canSaveForm =
|
||||
Boolean(props.formValue) && !props.loading && !formUnsafe;
|
||||
Boolean(props.formValue) && !props.loading;
|
||||
const canSave =
|
||||
props.connected &&
|
||||
!props.saving &&
|
||||
|
||||
Reference in New Issue
Block a user