Skip to content

Commit

Permalink
Do not wait to call workspace update events
Browse files Browse the repository at this point in the history
Signed-off-by: Davis Silverman <[email protected]>
  • Loading branch information
sinistersnare committed Nov 27, 2024
1 parent 62d567c commit 67e6be4
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/perspective-workspace/src/ts/workspace/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class PerspectiveWorkspace extends SplitPanel {
private _minimizedLayoutSlots?: DockPanel.ILayoutConfig;
private _minimizedLayout?: DockPanel.ILayoutConfig;
private _maximizedWidget?: PerspectiveViewerWidget;
private _save?: DebouncedFunc<() => false | Promise<void>>;
private _save?: () => false | Promise<void>;
private _context_menu?: Menu & { init_overlay?: () => void };

constructor(element: HTMLElement, options = {}) {
Expand Down Expand Up @@ -1028,12 +1028,9 @@ export class PerspectiveWorkspace extends SplitPanel {

async workspaceUpdated() {
if (!this._save) {
this._save = debounce(
() =>
this.dockpanel.mode !== "single-document" &&
this._fireUpdateEvent(),
500
);
this._save = () =>
this.dockpanel.mode !== "single-document" &&
this._fireUpdateEvent();
}

this._save();
Expand Down

0 comments on commit 67e6be4

Please sign in to comment.