Skip to content

Commit 17aa44d

Browse files
authored
Activate new settings dialog from default UI (#506)
1 parent d8887a4 commit 17aa44d

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/scripts/ui.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { ComfyDialog as _ComfyDialog } from './ui/dialog'
33
import { toggleSwitch } from './ui/toggleSwitch'
44
import { ComfySettingsDialog } from './ui/settings'
55
import { ComfyApp, app } from './app'
6-
import { StatusWsMessageStatus, TaskItem } from '@/types/apiTypes'
6+
import { TaskItem } from '@/types/apiTypes'
7+
import { showSettingsDialog } from '@/services/dialogService'
78

89
export const ComfyDialog = _ComfyDialog
910

@@ -505,7 +506,7 @@ export class ComfyUI {
505506
$el('div.comfy-menu-actions', [
506507
$el('button.comfy-settings-btn', {
507508
textContent: '⚙️',
508-
onclick: () => this.settings.show()
509+
onclick: showSettingsDialog
509510
}),
510511
$el('button.comfy-close-menu-btn', {
511512
textContent: '\u00d7',

src/services/dialogService.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
// This module is mocked in tests-ui/
2+
// Import vue components here to avoid tests-ui/ reporting errors
3+
// about importing primevue components.
14
import { useDialogStore } from '@/stores/dialogStore'
25
import LoadWorkflowWarning from '@/components/dialog/content/LoadWorkflowWarning.vue'
3-
import { markRaw } from 'vue'
6+
import SettingDialogContent from '@/components/dialog/content/SettingDialogContent.vue'
7+
import SettingDialogHeader from '@/components/dialog/header/SettingDialogHeader.vue'
48

59
export function showLoadWorkflowWarning(props: {
610
missingNodeTypes: any[]
@@ -9,7 +13,14 @@ export function showLoadWorkflowWarning(props: {
913
}) {
1014
const dialogStore = useDialogStore()
1115
dialogStore.showDialog({
12-
component: markRaw(LoadWorkflowWarning),
16+
component: LoadWorkflowWarning,
1317
props
1418
})
1519
}
20+
21+
export function showSettingsDialog() {
22+
useDialogStore().showDialog({
23+
headerComponent: SettingDialogHeader,
24+
component: SettingDialogContent
25+
})
26+
}

0 commit comments

Comments
 (0)