fix session links profile filtering (#979)

This commit is contained in:
ekko
2026-05-24 19:30:32 +08:00
committed by GitHub
parent acdf18793c
commit 6763721545
11 changed files with 13 additions and 23 deletions
@@ -25,7 +25,7 @@ const routeProfile = computed(() => {
})
async function loadRouteSession() {
await chatStore.loadSessions(routeProfile.value, routeSessionId.value)
await chatStore.loadSessions(chatStore.sessionProfileFilter, routeSessionId.value)
if (routeSessionId.value && chatStore.activeSessionId !== routeSessionId.value) {
await router.replace({ name: 'hermes.chat' })
}
@@ -45,19 +45,14 @@ onMounted(async () => {
watch([routeSessionId, routeProfile], async ([sessionId]) => {
if (!chatStore.sessionsLoaded) return
if (!sessionId) {
await chatStore.loadSessions(routeProfile.value)
return
}
if (chatStore.activeSessionId === sessionId && (!routeProfile.value || chatStore.activeSession?.profile === routeProfile.value)) return
if (routeProfile.value) {
await loadRouteSession()
await chatStore.loadSessions(chatStore.sessionProfileFilter)
return
}
if (chatStore.activeSessionId === sessionId) return
const exists = chatStore.sessions.some(session => session.id === sessionId)
if (!exists) {
await router.replace({ name: 'hermes.chat' })
await loadRouteSession()
return
}