Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Jan 2, 2025
1 parent 04111b3 commit 5f62f41
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ee/tabby-ui/app/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ const convertToHSLColor = (style: string) => {
}

export default function ChatPage() {
// if chat component loaded
const [isChatComponentLoaded, setIsChatComponentLoaded] = useState(false)
const [isServerInitialized, setIsServerInitialized] = useState(false)
const [isServerLoaded, setIsServerLoaded] = useState(false)
const [fetcherOptions, setFetcherOptions] = useState<FetcherOptions | null>(
null
)
Expand Down Expand Up @@ -256,7 +255,7 @@ export default function ChatPage() {

checkCapabilities().then(() => {
setTimeout(() => {
setIsServerInitialized(true)
setIsServerLoaded(true)
})
})
}
Expand All @@ -266,7 +265,7 @@ export default function ChatPage() {
if (!isChatComponentLoaded) return
if (
width &&
isServerInitialized &&
isServerLoaded &&
fetcherOptions &&
!errorMessage &&
!prevWidthRef.current
Expand Down Expand Up @@ -384,7 +383,7 @@ export default function ChatPage() {
)
}

if (!isServerInitialized || !fetcherOptions) {
if (!isServerLoaded || !fetcherOptions) {
return (
<StaticContent>
<>
Expand Down

0 comments on commit 5f62f41

Please sign in to comment.