diff --git a/app/components/TopNav.vue b/app/components/TopNav.vue index 43a80ad..fa40f98 100644 --- a/app/components/TopNav.vue +++ b/app/components/TopNav.vue @@ -8,13 +8,18 @@ const route = useRoute() const { loggedIn, user, clear, initialized } = useAuthSession() const { config: globalConfig } = useGlobalConfig() -const links: any = [ - { to: "/ideas", label: "创意" }, - { to: "/projects", label: "项目" }, - { to: "/articles", label: "文章" }, - { to: "/agent-documents", label: "文档" }, - { to: "/collect", label: "收藏" }, -] +const links: any = computed(() => { + const base = [ + { to: "/ideas", label: "创意" }, + { to: "/projects", label: "项目" }, + { to: "/articles", label: "文章" }, + ] + if (loggedIn.value) { + base.push({ to: "/agent-documents", label: "文档" }) + } + base.push({ to: "/collect", label: "收藏" }) + return base +}) let lastScrollY = 0 const HIDE_OFFSET = 520 diff --git a/app/components/agent/AgentChatArea.vue b/app/components/agent/AgentChatArea.vue index 02d0a89..c8137ef 100644 --- a/app/components/agent/AgentChatArea.vue +++ b/app/components/agent/AgentChatArea.vue @@ -24,6 +24,7 @@ const props = defineProps<{ sidebarCollapsed: boolean; errorMessage: string; systemPrompt?: string; + sessionId?: string | null; }>(); const emit = defineEmits<{ @@ -76,6 +77,14 @@ watch( } }, ); + +watch( + () => props.sessionId, + () => { + editingMessageId.value = null; + inputRef.value?.setText(""); + }, +);