mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
Fix missing new tab layouts (#402)
This commit is contained in:
parent
708af7efde
commit
7126c47ecc
@ -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.
|
||||
|
@ -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++ {
|
||||
|
Loading…
Reference in New Issue
Block a user