Skip to content

Commit

Permalink
Disable refetchOnWindowFocus instead (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
StreetLamb authored Jun 1, 2024
1 parent 803fbed commit 3f7ea24
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions frontend/src/components/Teams/ChatTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,9 @@ const ChatTeam = () => {
id: threadId!,
}),
{
/**
* Only run the query if messages state is empty and threadId is not null or undefined.
* Why only when empty? Thread data do not contain subgraphs history so its not ideal to overwrite while
* user might still be conversing.
*/
enabled: !!threadId && messages.length === 0,
// Only run the query if messages state is empty and threadId is not null or undefined.
enabled: !!threadId,
refetchOnWindowFocus: false,
onError: (err: ApiError) => {
const errDetail = err.body?.detail
showToast("Something went wrong.", `${errDetail}`, "error")
Expand Down

0 comments on commit 3f7ea24

Please sign in to comment.