Skip to content

Commit 7f2b8a5

Browse files
webfilteredgithub-actions
andauthored
[CodeHealth] Add various minor fixes - logging, missed i18n (#3895)
Co-authored-by: github-actions <[email protected]>
1 parent 59ce169 commit 7f2b8a5

File tree

12 files changed

+23
-18
lines changed

12 files changed

+23
-18
lines changed

src/components/graph/DomWidgets.vue

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
<script setup lang="ts">
1414
import type { LGraphNode } from '@comfyorg/litegraph'
15-
import { computed, watch } from 'vue'
15+
import { whenever } from '@vueuse/core'
16+
import { computed } from 'vue'
1617
1718
import DomWidget from '@/components/graph/widgets/DomWidget.vue'
1819
import { useChainCallback } from '@/composables/functional/useChainCallback'
@@ -54,18 +55,13 @@ const updateWidgets = () => {
5455
}
5556
5657
const canvasStore = useCanvasStore()
57-
watch(
58+
whenever(
5859
() => canvasStore.canvas,
59-
(lgCanvas) => {
60-
if (!lgCanvas) return
61-
62-
lgCanvas.onDrawForeground = useChainCallback(
63-
lgCanvas.onDrawForeground,
64-
() => {
65-
updateWidgets()
66-
}
67-
)
68-
},
60+
(canvas) =>
61+
(canvas.onDrawForeground = useChainCallback(
62+
canvas.onDrawForeground,
63+
updateWidgets
64+
)),
6965
{ immediate: true }
7066
)
7167
</script>

src/components/graph/GraphCanvas.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ import { usePaste } from '@/composables/usePaste'
7070
import { useWorkflowAutoSave } from '@/composables/useWorkflowAutoSave'
7171
import { useWorkflowPersistence } from '@/composables/useWorkflowPersistence'
7272
import { CORE_SETTINGS } from '@/constants/coreSettings'
73-
import { i18n } from '@/i18n'
73+
import { i18n, t } from '@/i18n'
7474
import type { NodeId } from '@/schemas/comfyWorkflowSchema'
7575
import { UnauthorizedError, api } from '@/scripts/api'
7676
import { app as comfyApp } from '@/scripts/app'
@@ -230,7 +230,7 @@ useEventListener(
230230
() => {
231231
toastStore.add({
232232
severity: 'warn',
233-
summary: 'No items selected',
233+
summary: t('toastMessages.nothingSelected'),
234234
life: 2000
235235
})
236236
},

src/locales/en/main.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,8 @@
12601260
"failedToAccessBillingPortal": "Failed to access billing portal: {error}",
12611261
"failedToPurchaseCredits": "Failed to purchase credits: {error}",
12621262
"unauthorizedDomain": "Your domain {domain} is not authorized to use this service. Please contact {email} to add your domain to the whitelist.",
1263-
"useApiKeyTip": "Tip: Can't access normal login? Use the Comfy API Key option."
1263+
"useApiKeyTip": "Tip: Can't access normal login? Use the Comfy API Key option.",
1264+
"nothingSelected": "Nothing selected"
12641265
},
12651266
"auth": {
12661267
"apiKey": {

src/locales/es/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@
13341334
"no3dSceneToExport": "No hay escena 3D para exportar",
13351335
"noTemplatesToExport": "No hay plantillas para exportar",
13361336
"nodeDefinitionsUpdated": "Definiciones de nodos actualizadas",
1337+
"nothingSelected": "Nada seleccionado",
13371338
"nothingToGroup": "Nada para agrupar",
13381339
"nothingToQueue": "Nada para poner en cola",
13391340
"pendingTasksDeleted": "Tareas pendientes eliminadas",

src/locales/fr/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@
13341334
"no3dSceneToExport": "Aucune scène 3D à exporter",
13351335
"noTemplatesToExport": "Aucun modèle à exporter",
13361336
"nodeDefinitionsUpdated": "Définitions de nœuds mises à jour",
1337+
"nothingSelected": "Aucune sélection",
13371338
"nothingToGroup": "Rien à regrouper",
13381339
"nothingToQueue": "Rien à ajouter à la file d’attente",
13391340
"pendingTasksDeleted": "Tâches en attente supprimées",

src/locales/ja/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@
13341334
"no3dSceneToExport": "エクスポートする3Dシーンがありません",
13351335
"noTemplatesToExport": "エクスポートするテンプレートがありません",
13361336
"nodeDefinitionsUpdated": "ノード定義が更新されました",
1337+
"nothingSelected": "選択されていません",
13371338
"nothingToGroup": "グループ化するものがありません",
13381339
"nothingToQueue": "キューに追加する項目がありません",
13391340
"pendingTasksDeleted": "保留中のタスクが削除されました",

src/locales/ko/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@
13341334
"no3dSceneToExport": "내보낼 3D 장면이 없습니다",
13351335
"noTemplatesToExport": "내보낼 템플릿이 없습니다",
13361336
"nodeDefinitionsUpdated": "노드 정의가 업데이트되었습니다",
1337+
"nothingSelected": "선택된 항목이 없습니다",
13371338
"nothingToGroup": "그룹화할 항목이 없습니다",
13381339
"nothingToQueue": "대기열에 추가할 항목이 없습니다",
13391340
"pendingTasksDeleted": "보류 중인 작업이 삭제되었습니다",

src/locales/ru/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@
13341334
"no3dSceneToExport": "Нет 3D сцены для экспорта",
13351335
"noTemplatesToExport": "Нет шаблонов для экспорта",
13361336
"nodeDefinitionsUpdated": "Определения узлов обновлены",
1337+
"nothingSelected": "Ничего не выбрано",
13371338
"nothingToGroup": "Нечего группировать",
13381339
"nothingToQueue": "Нет заданий в очереди",
13391340
"pendingTasksDeleted": "Ожидающие задачи удалены",

src/locales/zh/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@
13341334
"no3dSceneToExport": "没有3D场景可以导出",
13351335
"noTemplatesToExport": "没有模板可以导出",
13361336
"nodeDefinitionsUpdated": "节点定义已更新",
1337+
"nothingSelected": "未选择任何内容",
13371338
"nothingToGroup": "没有可分组的内容",
13381339
"nothingToQueue": "没有可加入队列的内容",
13391340
"pendingTasksDeleted": "待处理任务已删除",

src/scripts/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,7 @@ export class ComfyApp {
10901090
title: t('errorDialog.loadWorkflowTitle'),
10911091
reportType: 'loadWorkflowError'
10921092
})
1093+
console.error(error)
10931094
return
10941095
}
10951096
for (const node of this.graph.nodes) {
@@ -1229,6 +1230,7 @@ export class ComfyApp {
12291230
title: t('errorDialog.promptExecutionError'),
12301231
reportType: 'promptExecutionError'
12311232
})
1233+
console.error(error)
12321234

12331235
if (error instanceof PromptExecutionError) {
12341236
executionStore.lastNodeErrors = error.response.node_errors ?? null

0 commit comments

Comments
 (0)