fix(settings): resolve editor settings dialog TDZ crash

This commit is contained in:
Abeautifulsnow authored and GitHub committed 2026-07-17 21:15:00 +08:00
1 parent b749cb9bdb
commit af9c052708
1 file changed
+6 -5
@@ -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<string | null>(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<string | null>(null);
const displayedAiConfigs = computed(() => orderAiConfigsForDisplay(settingsStore.aiConfigs));
// AI Config Delete Confirmation
const aiDeleteConfirmOpen = ref(false);