(
waveWindow: WaveWindow,
fullConfig: FullConfigType,
opts: WindowOpts
)
| 698 | // note, this does not *show* the window. |
| 699 | // to show, await win.readyPromise and then win.show() |
| 700 | export async function createBrowserWindow( |
| 701 | waveWindow: WaveWindow, |
| 702 | fullConfig: FullConfigType, |
| 703 | opts: WindowOpts |
| 704 | ): Promise<WaveBrowserWindow> { |
| 705 | if (!waveWindow) { |
| 706 | console.log("createBrowserWindow: no waveWindow"); |
| 707 | waveWindow = await WindowService.CreateWindow(null, ""); |
| 708 | } |
| 709 | let workspace = await WorkspaceService.GetWorkspace(waveWindow.workspaceid); |
| 710 | if (!workspace) { |
| 711 | console.log("createBrowserWindow: no workspace, creating new window"); |
| 712 | await WindowService.CloseWindow(waveWindow.oid, true); |
| 713 | waveWindow = await WindowService.CreateWindow(null, ""); |
| 714 | workspace = await WorkspaceService.GetWorkspace(waveWindow.workspaceid); |
| 715 | } |
| 716 | console.log("createBrowserWindow", waveWindow.oid, workspace.oid, workspace); |
| 717 | const bwin = new WaveBrowserWindow(waveWindow, fullConfig, opts); |
| 718 | |
| 719 | if (workspace.activetabid) { |
| 720 | await bwin.setActiveTab(workspace.activetabid, false, opts.isPrimaryStartupWindow ?? false); |
| 721 | } |
| 722 | return bwin; |
| 723 | } |
| 724 | |
| 725 | ipcMain.on("set-active-tab", async (event, tabId) => { |
| 726 | const ww = getWaveWindowByWebContentsId(event.sender.id); |
no test coverage detected