Skip to content

Commit

Permalink
Add polling to comments every 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
camilovegag committed Apr 29, 2024
1 parent 03ca016 commit 31280f9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/berlin/src/pages/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function Option() {
queryKey: ['comments', optionId],
queryFn: () => fetchComments({ optionId: optionId || '' }),
enabled: !!optionId,
refetchInterval: 5000, // Poll every 5 seconds
});

const sortedComments = comments?.sort((a, b) => {
Expand Down

0 comments on commit 31280f9

Please sign in to comment.