From af9c052708fc587c205b7510080075e9d499abe9 Mon Sep 17 00:00:00 2001 From: Abeautifulsnow Date: Fri, 17 Jul 2026 21:15:00 +0800 Subject: [PATCH] fix(settings): resolve editor settings dialog TDZ crash --- .../src/components/editor/EditorSettingsDialog.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 074d24b4bc..357cf839f0 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -1801,6 +1801,12 @@ async function scrollToInitialSettingsSection() { } } +// AI Config List Mode — declared before the immediate watcher to avoid TDZ crash +const aiConfigListMode = ref<"list" | "edit">("list"); +const aiEditConfigName = ref(""); +const aiEditConfigId = ref(null); +const displayedAiConfigs = computed(() => orderAiConfigsForDisplay(settingsStore.aiConfigs)); + watch( () => settingsVisible.value, async (open) => { @@ -1934,11 +1940,6 @@ async function changePassword() { } // ---------- AI Settings ---------- -// AI Config List Mode -const aiConfigListMode = ref<"list" | "edit">("list"); -const aiEditConfigName = ref(""); -const aiEditConfigId = ref(null); -const displayedAiConfigs = computed(() => orderAiConfigsForDisplay(settingsStore.aiConfigs)); // AI Config Delete Confirmation const aiDeleteConfirmOpen = ref(false);