Commit b2dcb22 ryanontheinstide
committed
1 parent 654b8c1 commit b2dcb22 Copy full SHA for b2dcb22
File tree 1 file changed +24
-1
lines changed
1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,30 @@ const extension = {
120
120
"ComfyStream.RestartServer"
121
121
]
122
122
}
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
+ }
124
147
} ;
125
148
126
149
console . log ( "[ComfyStream] Registering extension:" , extension ) ;
You can’t perform that action at this time.
0 commit comments