mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
fix: improve locale change watcher to wait for settings and i18n in parallel
- Remove redundant useVueFeatureFlags() call - Wait for settings and i18n readiness in parallel instead of sequentially - Add warning log when locale changes during error state Amp-Thread-ID: https://ampcode.com/threads/T-019bfb8f-8b22-740f-a77d-9280bcc44be8 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -403,7 +403,6 @@ useNodeBadge()
|
|||||||
|
|
||||||
useGlobalLitegraph()
|
useGlobalLitegraph()
|
||||||
useContextMenuTranslation()
|
useContextMenuTranslation()
|
||||||
useVueFeatureFlags()
|
|
||||||
useCopy()
|
useCopy()
|
||||||
usePaste()
|
usePaste()
|
||||||
useWorkflowAutoSave()
|
useWorkflowAutoSave()
|
||||||
@@ -413,11 +412,15 @@ watch(
|
|||||||
() => settingStore.get('Comfy.Locale'),
|
() => settingStore.get('Comfy.Locale'),
|
||||||
async (_newLocale, oldLocale) => {
|
async (_newLocale, oldLocale) => {
|
||||||
if (!oldLocale) return
|
if (!oldLocale) return
|
||||||
await until(() => isSettingsReady.value || !!settingsError.value).toBe(true)
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
until(() => isI18nReady.value || !!i18nError.value).toBe(true),
|
until(() => isSettingsReady.value || !!settingsError.value).toBe(true),
|
||||||
newUserService().initializeIfNewUser(settingStore)
|
until(() => isI18nReady.value || !!i18nError.value).toBe(true)
|
||||||
])
|
])
|
||||||
|
if (settingsError.value || i18nError.value) {
|
||||||
|
console.warn(
|
||||||
|
'Somehow the Locale setting was changed while the settings or i18n had a setup error'
|
||||||
|
)
|
||||||
|
}
|
||||||
await useCommandStore().execute('Comfy.RefreshNodeDefinitions')
|
await useCommandStore().execute('Comfy.RefreshNodeDefinitions')
|
||||||
await useWorkflowService().reloadCurrentWorkflow()
|
await useWorkflowService().reloadCurrentWorkflow()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user