mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	fix: Correct merge logic for state updates in sync utility
This commit is contained in:
		@@ -153,9 +153,9 @@ export function mergeWithUpdate<T extends { lastUpdateTime?: number }>(
 | 
			
		||||
  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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user