Skip to content

Commit

Permalink
fix: file input update delay (#2540)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Mar 29, 2024
1 parent 228a363 commit 1451f67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/hooks/useSendChatMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ export default function useSendChatMessage() {
selectedModelRef.current?.id ??
activeThreadRef.current.assistants[0].model.id

if (base64Blob) {
setFileUpload([])
}

if (modelRef.current?.id !== modelId) {
setQueuedMessage(true)
const error = await startModel(modelId).catch((error: Error) => error)
Expand Down Expand Up @@ -262,10 +266,6 @@ export default function useSendChatMessage() {
// Reset states
setReloadModel(false)
setEngineParamsUpdate(false)

if (base64Blob) {
setFileUpload([])
}
}

return {
Expand Down

0 comments on commit 1451f67

Please sign in to comment.