Skip to content

Commit

Permalink
fix(ui): ensure top action buttons in answer engine display timely
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Dec 30, 2024
1 parent eae43ba commit 1acfc6f
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 186 deletions.
13 changes: 6 additions & 7 deletions ee/tabby-ui/app/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import tabbyUrl from '@/assets/logo-dark.png'
import { useQuery } from 'urql'
import { useStore } from 'zustand'

import { SESSION_STORAGE_KEY } from '@/lib/constants'
import { useMe } from '@/lib/hooks/use-me'
import { useSelectedModel } from '@/lib/hooks/use-models'
import { useSelectedRepository } from '@/lib/hooks/use-repositories'
Expand All @@ -17,6 +16,7 @@ import {
} from '@/lib/hooks/use-server-info'
import { setThreadsPageNo } from '@/lib/stores/answer-engine-store'
import {
updatePendingUserMessage,
updateSelectedModel,
updateSelectedRepoSourceId
} from '@/lib/stores/chat-actions'
Expand Down Expand Up @@ -94,13 +94,12 @@ function MainPanel() {
updateSelectedRepoSourceId(sourceId)
}

const onSearch = (question: string, ctx?: ThreadRunContexts) => {
const onSearch = (question: string, context?: ThreadRunContexts) => {
setIsLoading(true)
sessionStorage.setItem(SESSION_STORAGE_KEY.SEARCH_INITIAL_MSG, question)
sessionStorage.setItem(
SESSION_STORAGE_KEY.SEARCH_INITIAL_CONTEXTS,
JSON.stringify(ctx)
)
updatePendingUserMessage({
content: question,
context
})
router.push('/search')
}

Expand Down
Loading

0 comments on commit 1acfc6f

Please sign in to comment.