Forgot to set generation atom (#28)

This commit is contained in:
Evan Simkowitz 2024-06-06 18:07:00 -07:00 committed by GitHub
parent 86109daeed
commit 57e5b7284f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,7 +42,10 @@ export function withLayoutTreeState<T>(layoutNodeAtom: WritableLayoutNodeAtom<T>
},
(get, set, value) => {
set(pendingActionAtom, value.pendingAction);
if (get(generationAtom) !== value.generation) set(layoutNodeAtom, value.rootNode);
if (get(generationAtom) !== value.generation) {
set(generationAtom, value.generation);
set(layoutNodeAtom, value.rootNode);
}
}
);
}