Fix networked state update overriding current changes
This commit is contained in:
parent
b803f7b4d8
commit
613beff72e
@ -91,7 +91,9 @@ function useNetworkedState(
|
||||
if (prevState && prevState[partialUpdatesKey] === update.id) {
|
||||
let newState = { ...prevState };
|
||||
applyChanges(newState, update.changes);
|
||||
lastSyncedStateRef.current = newState;
|
||||
if (lastSyncedStateRef.current) {
|
||||
applyChanges(lastSyncedStateRef.current, update.changes);
|
||||
}
|
||||
return newState;
|
||||
} else {
|
||||
return prevState;
|
||||
|
Loading…
Reference in New Issue
Block a user