(workspaceId: string)
| 368 | } |
| 369 | |
| 370 | async switchWorkspace(workspaceId: string) { |
| 371 | console.log("switchWorkspace", workspaceId, this.waveWindowId); |
| 372 | if (workspaceId == this.workspaceId) { |
| 373 | console.log("switchWorkspace already on this workspace", this.waveWindowId); |
| 374 | return; |
| 375 | } |
| 376 | |
| 377 | // If the workspace is already owned by a window, then we can just call SwitchWorkspace without first prompting the user, since it'll just focus to the other window. |
| 378 | const workspaceList = await WorkspaceService.ListWorkspaces(); |
| 379 | if (!workspaceList?.find((wse) => wse.workspaceid === workspaceId)?.windowid) { |
| 380 | const curWorkspace = await WorkspaceService.GetWorkspace(this.workspaceId); |
| 381 | |
| 382 | if (curWorkspace && isNonEmptyUnsavedWorkspace(curWorkspace)) { |
| 383 | console.log( |
| 384 | `existing unsaved workspace ${this.workspaceId} has content, opening workspace ${workspaceId} in new window` |
| 385 | ); |
| 386 | await createWindowForWorkspace(workspaceId); |
| 387 | return; |
| 388 | } |
| 389 | } |
| 390 | await this._queueActionInternal({ op: "switchworkspace", workspaceId }); |
| 391 | } |
| 392 | |
| 393 | async setActiveTab(tabId: string, setInBackend: boolean, primaryStartupTab = false) { |
| 394 | console.log( |
no test coverage detected