Skip to content

Commit

Permalink
fix: Fix wrong fetching of lastRunDate state in record component
Browse files Browse the repository at this point in the history
  • Loading branch information
ximu3 committed Nov 27, 2024
1 parent e123954 commit 8fefde3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/renderer/src/components/Game/Record/RecordCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ export function RecordCard({
const { getGameMaxPlayTimeDay, getGamePlayDays } = useGameRecords()
const playDays = getGamePlayDays(gameId)
const [playingTime] = useDBSyncedState(0, `games/${gameId}/record.json`, ['playingTime'])
const [timer] = useDBSyncedState([], `games/${gameId}/record.json`, []) as any
const [lastRunDate] = useDBSyncedState('', `games/${gameId}/record.json`, ['lastRunDate'])
const equalPlayingTime = playingTime / playDays
const lastRunDate = timer[timer.length - 1]?.start
const maxPlayTimeDay = getGameMaxPlayTimeDay(gameId)
return (
<Card className={cn(className, 'p-3 w-auto')}>
Expand Down

0 comments on commit 8fefde3

Please sign in to comment.