Skip to content

Commit b2dcb22

Browse files
author
ryanontheinstide
committed
menu system fix
1 parent 654b8c1 commit b2dcb22

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

nodes/web/js/launcher.js

+24-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,30 @@ const extension = {
120120
"ComfyStream.RestartServer"
121121
]
122122
}
123-
]
123+
],
124+
125+
// Setup function to handle menu registration based on settings
126+
setup() {
127+
console.log("[ComfyStream] Setting up extension");
128+
const useNewMenu = app.ui.settings.store.get("Comfy.UseNewMenu");
129+
console.log("[ComfyStream] Menu setting:", useNewMenu);
130+
131+
if (useNewMenu === "Disabled") {
132+
// Old menu system
133+
console.log("[ComfyStream] Using old menu system");
134+
const menu = app.ui.menu;
135+
menu.addSeparator();
136+
const comfyStreamMenu = menu.addMenu("ComfyStream");
137+
comfyStreamMenu.addItem("Open UI", openUI, { icon: "pi pi-external-link" });
138+
comfyStreamMenu.addSeparator();
139+
comfyStreamMenu.addItem("Start Server", () => controlServer('start'), { icon: "pi pi-play" });
140+
comfyStreamMenu.addItem("Stop Server", () => controlServer('stop'), { icon: "pi pi-stop" });
141+
comfyStreamMenu.addItem("Restart Server", () => controlServer('restart'), { icon: "pi pi-refresh" });
142+
} else {
143+
// New menu system is handled automatically by the menuCommands registration
144+
console.log("[ComfyStream] Using new menu system");
145+
}
146+
}
124147
};
125148

126149
console.log("[ComfyStream] Registering extension:", extension);

0 commit comments

Comments
 (0)