From 357b74da590a2fefbc928fc7f5eb9e16cf17e181 Mon Sep 17 00:00:00 2001 From: michaelia Date: Fri, 21 Feb 2025 13:01:33 +0000 Subject: [PATCH] fix: Correct merge logic for state updates in sync utility --- app/utils/sync.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/utils/sync.ts b/app/utils/sync.ts index 1acfc1289..2dc770349 100644 --- a/app/utils/sync.ts +++ b/app/utils/sync.ts @@ -153,9 +153,9 @@ export function mergeWithUpdate( remoteState: T, ) { const localUpdateTime = localState.lastUpdateTime ?? 0; - const remoteUpdateTime = localState.lastUpdateTime ?? 1; + const remoteUpdateTime = remoteState.lastUpdateTime ?? 1; - if (localUpdateTime < remoteUpdateTime) { + if (localUpdateTime > remoteUpdateTime) { merge(remoteState, localState); return { ...remoteState }; } else {