Skip to content

Commit 6edfc9b

Browse files
authored
Use settingStore to access setting (#572)
1 parent 743dc48 commit 6edfc9b

File tree

4 files changed

+85
-10
lines changed

4 files changed

+85
-10
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"last_node_id": 1,
3+
"last_link_id": 0,
4+
"nodes": [
5+
{
6+
"id": 1,
7+
"type": "UNKNOWN NODE",
8+
"pos": [
9+
48,
10+
86
11+
],
12+
"size": {
13+
"0": 358.80780029296875,
14+
"1": 314.7989501953125
15+
},
16+
"flags": {},
17+
"order": 0,
18+
"mode": 0,
19+
"inputs": [
20+
{
21+
"name": "image",
22+
"type": "IMAGE",
23+
"link": null,
24+
"slot_index": 0
25+
}
26+
],
27+
"outputs": [
28+
{
29+
"name": "STRING",
30+
"type": "STRING",
31+
"links": [],
32+
"slot_index": 0,
33+
"shape": 6
34+
}
35+
],
36+
"properties": {
37+
"Node name for S&R": "UNKNOWN NODE"
38+
},
39+
"widgets_values": [
40+
"wd-v1-4-moat-tagger-v2",
41+
0.35,
42+
0.85,
43+
false,
44+
false,
45+
""
46+
]
47+
}
48+
],
49+
"links": [],
50+
"groups": [],
51+
"config": {},
52+
"extra": {
53+
"ds": {
54+
"scale": 1,
55+
"offset": [
56+
0, 0
57+
]
58+
}
59+
},
60+
"version": 0.4
61+
}

browser_tests/interaction.spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from '@playwright/test'
2-
import { ComfyPage, comfyPageFixture as test } from './ComfyPage'
2+
import { comfyPageFixture as test } from './ComfyPage'
33

44
test.describe('Node Interaction', () => {
55
test('Can enter prompt', async ({ comfyPage }) => {
@@ -104,10 +104,14 @@ test.describe('Node Interaction', () => {
104104
test('Can toggle dom widget node open/closed', async ({ comfyPage }) => {
105105
await expect(comfyPage.canvas).toHaveScreenshot('default.png')
106106
await comfyPage.clickTextEncodeNodeToggler()
107-
await expect(comfyPage.canvas).toHaveScreenshot('text-encode-toggled-off.png')
107+
await expect(comfyPage.canvas).toHaveScreenshot(
108+
'text-encode-toggled-off.png'
109+
)
108110
await comfyPage.delay(1000)
109111
await comfyPage.clickTextEncodeNodeToggler()
110-
await expect(comfyPage.canvas).toHaveScreenshot('text-encode-toggled-back-open.png')
112+
await expect(comfyPage.canvas).toHaveScreenshot(
113+
'text-encode-toggled-back-open.png'
114+
)
111115
})
112116
})
113117

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { expect } from '@playwright/test'
2+
import { comfyPageFixture as test } from './ComfyPage'
3+
4+
test.describe('Load workflow warning', () => {
5+
test('Should display a warning when loading a workflow with missing nodes', async ({
6+
comfyPage
7+
}) => {
8+
await comfyPage.loadWorkflow('missing_nodes')
9+
10+
// Wait for the element with the .comfy-missing-nodes selector to be visible
11+
const missingNodesWarning = comfyPage.page.locator('.comfy-missing-nodes')
12+
await expect(missingNodesWarning).toBeVisible()
13+
})
14+
})

src/scripts/app.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,13 +2158,9 @@ export class ComfyApp {
21582158

21592159
showMissingNodesError(missingNodeTypes, hasAddedNodes = true) {
21602160
if (
2161-
!this.ui.settings.getSettingValue(
2162-
'Comfy.Workflow.ShowMissingNodesWarning'
2163-
)
2164-
)
2165-
return
2166-
2167-
if (this.vueAppReady) {
2161+
this.vueAppReady &&
2162+
useSettingStore().get('Comfy.Workflow.ShowMissingNodesWarning')
2163+
) {
21682164
showLoadWorkflowWarning({
21692165
missingNodeTypes,
21702166
hasAddedNodes,

0 commit comments

Comments
 (0)