feat: 更换模型时,重置所有选项

This commit is contained in:
SuperManTouX 2026-03-09 15:53:58 +08:00
parent 2706a0c732
commit 18cedb5d14
2 changed files with 19 additions and 0 deletions

View File

@ -173,6 +173,8 @@ import AttachmentPreview from "./AttachmentPreview.vue";
import { generateId } from "@/utils/helpers";
import type { Attachment } from "@/types/chat";
import { chatApi } from "@/services/api";
import { useAuthStore } from "@/stores/auth";
import { useSettingsStore } from "@/stores/settings";
interface AttachmentWithProgress extends Attachment {
uploading?: boolean;
@ -216,6 +218,9 @@ const emit = defineEmits<{
}>();
//
const authStore = useAuthStore();
const settingsStore = useSettingsStore();
const inputText = ref("");
const attachments = ref<AttachmentWithProgress[]>([]);
const isFocused = ref(false);
@ -467,6 +472,15 @@ watch(inputText, () => {
autoResize();
});
});
//
watch(
() => settingsStore.settings.defaultModel,
() => {
isDeepSearch.value = false;
isDeepThinking.value = false;
isWebSearch.value = false;
},
);
onMounted(() => {
autoResize();

View File

@ -212,6 +212,11 @@ function selectModel(modelId: string, modelName: string) {
localStorage.setItem("modelSelect", modelName);
settingsStore.setSelectedModelId(modelId); // ID
showModelMenu.value = false;
//
localStorage.setItem("isDeepSearch", "false");
localStorage.setItem("isDeepThinking", "false");
localStorage.setItem("isWebSearch", "false");
}
//