fix: merge with remote games setting 1970 sometimes

This commit is contained in:
Zamitto 2024-06-20 21:55:16 -03:00
parent b115bf632a
commit fb416b6483

View File

@ -19,7 +19,8 @@ export const mergeWithRemoteGames = async () => {
if (localGame) {
const updatedLastTimePlayed =
localGame.lastTimePlayed == null ||
new Date(game.lastTimePlayed) > localGame.lastTimePlayed
(game.lastTimePlayed &&
new Date(game.lastTimePlayed) > localGame.lastTimePlayed)
? new Date(game.lastTimePlayed)
: localGame.lastTimePlayed;