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);