fix(schedules): record the deployed enabled state however the editor opened

The reading sat inside the branch that captures a baseline, so a schedule opened
with a config handed in — the trigger panel of a script or flow — never took
one, and a save there settled against whatever the last open had left. Both ways
in hold the deployed state on the form at that point, which is what the reading
is about.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcyBRxE8j3ujCYkum9KrC4
This commit is contained in:
Diego Imbert
2026-09-06 16:08:36 +02:00
co-authored by Claude Opus 5
parent 2583569150
commit e3c0f532ff
@@ -198,12 +198,12 @@
draftOnly = noDeployed
if (!defaultCfg) {
// Form holds DEPLOYED here; capture it as `initialConfig` so the
// dirty check / banner fires whenever a saved draft exists. This is also
// the only point where the deployed `enabled` is on the form — the draft
// overlay below can carry one of its own, which the server has not taken.
// dirty check / banner fires whenever a saved draft exists.
initialConfig = structuredClone($state.snapshot(getScheduleCfg()))
deployedEnabled = enabled
}
// Whichever way this opened, the form holds the deployed state until the
// overlay below — which can carry an `enabled` the server has not taken.
deployedEnabled = enabled
if (draftOverlay) await loadScheduleCfg(draftOverlay)
await draftSync.maybeRestore()
} finally {