Reload current workflow when locale changes (#1824)

This commit is contained in:
Chenlei Hu
2024-12-06 14:37:25 -08:00
committed by GitHub
parent 517ae56763
commit fd621f485e
2 changed files with 25 additions and 4 deletions

View File

@@ -64,6 +64,7 @@ import { setStorageValue } from '@/scripts/utils'
import { ChangeTracker } from '@/scripts/changeTracker'
import { api } from '@/scripts/api'
import { useCommandStore } from '@/stores/commandStore'
import { workflowService } from '@/services/workflowService'
const emit = defineEmits(['ready'])
const canvasRef = ref<HTMLCanvasElement | null>(null)
@@ -317,8 +318,9 @@ onMounted(async () => {
// Start watching for locale change after the initial value is loaded.
watch(
() => settingStore.get('Comfy.Locale'),
() => {
useCommandStore().execute('Comfy.RefreshNodeDefinitions')
async () => {
await useCommandStore().execute('Comfy.RefreshNodeDefinitions')
workflowService.reloadCurrentWorkflow()
}
)