Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not wait to call workspace update events #2860

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading