Movie Editor: make Reset Studio session a toggle (disarmable)

Clicking 'Reset Studio session' again now cancels a pending reset (mis-click safe);
the menu shows 'armed — click to cancel' when set.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
digital-garbage
2026-06-07 14:47:53 +03:00
co-authored by Claude Opus 4.8
parent 8ce0a24c40
commit c39af077ab
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -87,7 +87,7 @@
{ label: "Refresh model list", hint: "R", action: async () => { try { await window.MovieEditorAPI.refreshModels(); } catch (_) {} } },
],
FunPack: [
{ label: st.resetSessionArmed ? "Reset Studio session ✓ (armed)" : "Reset Studio session",
{ label: st.resetSessionArmed ? "Reset Studio session ✓ armed — click to cancel" : "Reset Studio session",
disabled: !hasProject(), action: () => S.resetStudioSession() },
{ sep: true },
{ menulabel: "Libraries (in ComfyUI Studio)" },
+4 -3
View File
@@ -420,11 +420,12 @@
});
}
// Arm a Studio session reset — applied to the FIRST run of the next generation.
// Toggle a pending Studio session reset — applied to the FIRST run of the next
// generation. Clicking again disarms it (in case of a mis-click).
let _resetSessionPending = false;
function resetStudioSession() {
_resetSessionPending = true;
set({ resetSessionArmed: true });
_resetSessionPending = !_resetSessionPending;
set({ resetSessionArmed: _resetSessionPending });
}
// Generate one run (single scene, or an explicit list of scene ids). Returns success.