Skip to content

Commit

Permalink
fix(ui): resolve abnormal display issue for non-existent threads
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Nov 26, 2024
1 parent b6b8d60 commit 57769e8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ee/tabby-ui/app/search/components/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ export function Search() {
if (!meData) return false
if (!threadIdFromURL) return true

return meData.me.id === threadData?.threads.edges[0].node.userId
const thread = threadData?.threads.edges[0]
if (!thread) return false

return meData.me.id === thread.node.userId
}, [meData, threadData, threadIdFromURL])

// Compute title
Expand Down Expand Up @@ -286,7 +289,7 @@ export function Search() {
// FIXME error view?
setIsReady(true)
}
}, [threadMessagesError])
}, [threadMessagesError])

// `/search` -> `/search/{slug}-{threadId}`
const updateThreadURL = (threadId: string) => {
Expand Down

0 comments on commit 57769e8

Please sign in to comment.