fix: remove debounce on setTreeStateAtomUpdated

This commit is contained in:
Sylvia Crowe 2024-09-19 16:02:59 -07:00
parent 5d62613fb8
commit 466a659ef2

View File

@ -377,7 +377,7 @@ export class LayoutModel {
* Callback that is invoked when the upstream tree state has been updated. This ensures the model is updated if the atom is not fully loaded when the model is first instantiated. * Callback that is invoked when the upstream tree state has been updated. This ensures the model is updated if the atom is not fully loaded when the model is first instantiated.
* @param force Whether to force the local tree state to update, regardless of whether the state is already up to date. * @param force Whether to force the local tree state to update, regardless of whether the state is already up to date.
*/ */
onTreeStateAtomUpdated = debounce(50, async (force = false) => { async onTreeStateAtomUpdated(force = false) {
const treeState = this.getter(this.treeStateAtom); const treeState = this.getter(this.treeStateAtom);
// Only update the local tree state if it is different from the one in the upstream atom. This function is called even when the update was initiated by the LayoutModel, so we need to filter out false positives or we'll enter an infinite loop. // Only update the local tree state if it is different from the one in the upstream atom. This function is called even when the update was initiated by the LayoutModel, so we need to filter out false positives or we'll enter an infinite loop.
if ( if (
@ -453,7 +453,7 @@ export class LayoutModel {
this.setTreeStateAtom(force); this.setTreeStateAtom(force);
} }
} }
}); }
/** /**
* Set the upstream tree state atom to the value of the local tree state. * Set the upstream tree state atom to the value of the local tree state.