mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-11 02:20:08 +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()
|
||||
useContextMenuTranslation()
|
||||
useVueFeatureFlags()
|
||||
useCopy()
|
||||
usePaste()
|
||||
useWorkflowAutoSave()
|
||||
@@ -413,11 +412,15 @@ watch(
|
||||
() => settingStore.get('Comfy.Locale'),
|
||||
async (_newLocale, oldLocale) => {
|
||||
if (!oldLocale) return
|
||||
await until(() => isSettingsReady.value || !!settingsError.value).toBe(true)
|
||||
await Promise.all([
|
||||
until(() => isI18nReady.value || !!i18nError.value).toBe(true),
|
||||
newUserService().initializeIfNewUser(settingStore)
|
||||
until(() => isSettingsReady.value || !!settingsError.value).toBe(true),
|
||||
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 useWorkflowService().reloadCurrentWorkflow()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user