Skip to content

Commit

Permalink
clean up interval
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewuu committed Jan 19, 2025
1 parent d18c8d5 commit a6dc69d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ export default function ContributorData(props: ContributorDataProps) {
const [time, setTime] = useState<string>(getCurrentTime(tz))

useEffect(() => {
setInterval(() => {
const interval = setInterval(() => {
setTime(getCurrentTime(tz))
}, 30000)
}, [])

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

return (
<div className={styles.root}>
Expand Down

0 comments on commit a6dc69d

Please sign in to comment.