()
| 829 | }); |
| 830 | |
| 831 | export async function createNewWaveWindow() { |
| 832 | log("createNewWaveWindow"); |
| 833 | const clientData = await ClientService.GetClientData(); |
| 834 | const fullConfig = await RpcApi.GetFullConfigCommand(ElectronWshClient); |
| 835 | let recreatedWindow = false; |
| 836 | const allWindows = getAllWaveWindows(); |
| 837 | if (allWindows.length === 0 && clientData?.windowids?.length >= 1) { |
| 838 | console.log("no windows, but clientData has windowids, recreating first window"); |
| 839 | // reopen the first window |
| 840 | const existingWindowId = clientData.windowids[0]; |
| 841 | const existingWindowData = (await ObjectService.GetObject("window:" + existingWindowId)) as WaveWindow; |
| 842 | if (existingWindowData != null) { |
| 843 | const win = await createBrowserWindow(existingWindowData, fullConfig, { |
| 844 | unamePlatform, |
| 845 | isPrimaryStartupWindow: false, |
| 846 | }); |
| 847 | if (quakeWindow == null) { |
| 848 | quakeWindow = win; |
| 849 | } |
| 850 | win.show(); |
| 851 | recreatedWindow = true; |
| 852 | } |
| 853 | } |
| 854 | if (recreatedWindow) { |
| 855 | console.log("recreated window, returning"); |
| 856 | return; |
| 857 | } |
| 858 | console.log("creating new window"); |
| 859 | const newBrowserWindow = await createBrowserWindow(null, fullConfig, { |
| 860 | unamePlatform, |
| 861 | isPrimaryStartupWindow: false, |
| 862 | }); |
| 863 | if (quakeWindow == null) { |
| 864 | quakeWindow = newBrowserWindow; |
| 865 | } |
| 866 | newBrowserWindow.show(); |
| 867 | } |
| 868 | |
| 869 | export async function relaunchBrowserWindows() { |
| 870 | console.log("relaunchBrowserWindows"); |
no test coverage detected