Skip to content

Commit

Permalink
Fix autoolling to run every 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsMurumba committed Sep 5, 2024
1 parent 336ec6e commit 7d11535
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,17 @@ const App: React.FC = () => {

useEffect(() => {
const interval = setInterval(() => {
if (timestampFilter) {
fetchTransactionLogs(timestampFilter)
}
const currentTimestamp = new Date().toISOString()
setTimestampFilter(currentTimestamp)
}, 5000)

return () => clearInterval(interval)
}, [])

useEffect(() => {
if (timestampFilter) {
fetchTransactionLogs(timestampFilter)
}
}, [timestampFilter, fetchTransactionLogs])

const handleTabChange = (event: React.ChangeEvent<{}>, newValue: number) => {
Expand Down

0 comments on commit 7d11535

Please sign in to comment.