Skip to content

Commit

Permalink
upd pdf loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangShuuu committed Dec 13, 2023
1 parent ba5bc61 commit 89e534b
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/components/chat/ChatContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export const ChatContextProvider = ({ fileId, children }: Props) => {
const { value, done: doneReading } = await reader.read()
done = doneReading
const chunkValue = decoder.decode(value)
console.log('chunkValue', chunkValue, doneReading)

accResponse += chunkValue

Expand All @@ -128,14 +127,11 @@ export const ChatContextProvider = ({ fileId, children }: Props) => {

let isAiResponseCreated = old.pages.some((page) =>
page.messages.some((message) => {
console.log('page.messages', message)
return message.id === 'ai-response'
})
)
console.log('isAiResponseCreated', isAiResponseCreated)

let updatedPages = old.pages.map((page) => {
console.log('old.pages.map', page, old.pages[0])
if (page === old.pages[0]) {
let updatedMessages

Expand All @@ -160,17 +156,14 @@ export const ChatContextProvider = ({ fileId, children }: Props) => {
return message
})
}
console.log('return', page, updatedMessages)

return {
...page,
messages: updatedMessages
}
}
console.log('return02', page)
return page
})
console.log('return03', old, updatedPages)
return { ...old, pages: updatedPages }
})
}
Expand Down

0 comments on commit 89e534b

Please sign in to comment.