Fix missing new tab layouts (#402)

This commit is contained in:
Evan Simkowitz 2024-09-19 12:59:09 -07:00 committed by GitHub
parent 708af7efde
commit 7126c47ecc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

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.
* @param force Whether to force the local tree state to update, regardless of whether the state is already up to date.
*/
async onTreeStateAtomUpdated(force = false) {
onTreeStateAtomUpdated = debounce(50, async (force = false) => {
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.
if (
@ -453,7 +453,7 @@ export class LayoutModel {
this.setTreeStateAtom(force);
}
}
}
});
/**
* Set the upstream tree state atom to the value of the local tree state.

View File

@ -120,6 +120,7 @@ func QueueLayoutActionForTab(ctx context.Context, tabId string, actions ...waveo
}
func ApplyPortableLayout(ctx context.Context, tabId string, layout PortableLayout) error {
log.Printf("ApplyPortableLayout, tabId: %s, layout: %v\n", tabId, layout)
actions := make([]waveobj.LayoutActionData, len(layout)+1)
actions[0] = waveobj.LayoutActionData{ActionType: LayoutActionDataType_ClearTree}
for i := 0; i < len(layout); i++ {