From 05bf65193938ab35f0104b4271ad90ed66537d55 Mon Sep 17 00:00:00 2001 From: William Oldham Date: Wed, 6 Dec 2023 19:59:50 +0000 Subject: [PATCH] Revert "Use date to compare progress items" This reverts commit cf0125755ccf4b0d20a0ad0b9b2a3f46c4fc6485. --- src/routes/users/progress.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/routes/users/progress.ts b/src/routes/users/progress.ts index fbeb4e5..cc3e649 100644 --- a/src/routes/users/progress.ts +++ b/src/routes/users/progress.ts @@ -100,9 +100,10 @@ export const userProgressRouter = makeRouter((app) => { if (newItemIndex > -1) { const newItem = newItems[newItemIndex]; - const newItemDate = defaultAndCoerceDateTime(newItem.updatedAt); - if (existingItem.updatedAt.getTime() < newItemDate.getTime()) { - existingItem.updatedAt = newItemDate; + if (existingItem.watched < newItem.watched) { + existingItem.updatedAt = defaultAndCoerceDateTime( + newItem.updatedAt, + ); existingItem.watched = newItem.watched; } itemsUpserted.push(existingItem);