Skip to content

Commit

Permalink
perf: optimize homepage data loading
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyTseng committed Jun 27, 2024
1 parent 6f40591 commit df0f042
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export default function Home(): JSX.Element {
const cache = window.localStorage.getItem('home')
if (cache) {
const { eventStatistics, totalEventCount, expireTimestamp } = JSON.parse(cache)
setEventStatistics(eventStatistics)
setTotalEventCount(totalEventCount)
if (!!expireTimestamp && expireTimestamp > Date.now()) {
setEventStatistics(eventStatistics)
setTotalEventCount(totalEventCount)
return
}
}
Expand Down

0 comments on commit df0f042

Please sign in to comment.