GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: fix workspace openEditorWindow API bugs · fecqs/lowcode-engine@5c13918

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/workspace/src
    • workspace.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/workspace/src/workspace.ts‎

Copy file name to clipboardExpand all lines: packages/workspace/src/workspace.ts
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ export class Workspace implements IWorkspace {
130130
}
131131

132132
const windowInfo = this.windowQueue.shift();
133-
if (windowInfo) {
133+
if (windowInfo instanceof Resource) {
134+
this.openEditorWindowByResource(windowInfo);
135+
} else if (windowInfo) {
134136
this.openEditorWindow(windowInfo.name, windowInfo.title, windowInfo.options, windowInfo.viewName);
135137
}
136138
}
@@ -251,7 +253,7 @@ export class Workspace implements IWorkspace {
251253
}
252254

253255
async openEditorWindowByResource(resource: IResource, sleep: boolean = false): Promise<void> {
254-
if (this.window && !this.window?.initReady && !sleep) {
256+
if (this.window && !this.window.sleep && !this.window?.initReady && !sleep) {
255257
this.windowQueue.push(resource);
256258
return;
257259
}
@@ -292,7 +294,7 @@ export class Workspace implements IWorkspace {
292294
}
293295

294296
async openEditorWindow(name: string, title: string, options: Object, viewName?: string, sleep?: boolean) {
295-
if (this.window && !this.window?.initReady && !sleep) {
297+
if (this.window && !this.window.sleep && !this.window?.initReady && !sleep) {
296298
this.windowQueue.push({
297299
name, title, options, viewName,
298300
});
@@ -304,7 +306,7 @@ export class Workspace implements IWorkspace {
304306
return;
305307
}
306308
this.window?.updateState(WINDOW_STATE.inactive);
307-
const filterWindows = this.windows.filter(d => (d.resource?.name === name && d.resource.title == title));
309+
const filterWindows = this.windows.filter(d => (d.resource?.name === name && d.resource.title == title) || (d.resource.id == title));
308310
if (filterWindows && filterWindows.length) {
309311
this.window = filterWindows[0];
310312
if (!sleep && this.window.sleep) {
@@ -320,6 +322,7 @@ export class Workspace implements IWorkspace {
320322
resourceName: name,
321323
title,
322324
options,
325+
id: title?.toString(),
323326
}, resourceType, this);
324327
const window = new EditorWindow(resource, this, {
325328
title,

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.