This commit is contained in:
alex
2025-04-17 12:49:00 +08:00
committed by GitHub

View File

@@ -153,9 +153,9 @@ export function mergeWithUpdate<T extends { lastUpdateTime?: number }>(
remoteState: T, remoteState: T,
) { ) {
const localUpdateTime = localState.lastUpdateTime ?? 0; const localUpdateTime = localState.lastUpdateTime ?? 0;
const remoteUpdateTime = localState.lastUpdateTime ?? 1; const remoteUpdateTime = remoteState.lastUpdateTime ?? 1;
if (localUpdateTime < remoteUpdateTime) { if (localUpdateTime > remoteUpdateTime) {
merge(remoteState, localState); merge(remoteState, localState);
return { ...remoteState }; return { ...remoteState };
} else { } else {