|
@@ -1,5 +1,5 @@
|
|
|
import { join } from "node:path";
|
|
|
-import { BrowserWindow, shell } from "electron";
|
|
|
+import { BrowserWindow, shell, ipcMain } from "electron";
|
|
|
import { isLinux, isMac, isWin } from "../utils";
|
|
|
import { destroyTray } from "./trayManage";
|
|
|
import { getStore } from "./storeManage";
|
|
@@ -9,6 +9,7 @@ import { registerShortcuts, unregisterShortcuts } from "./shortcutManage";
|
|
|
const url = process.env.VITE_DEV_SERVER_URL;
|
|
|
let mainWindow: BrowserWindow | null = null;
|
|
|
let splashWindow: BrowserWindow | null = null;
|
|
|
+let callingWindow: BrowserWindow | null = null;
|
|
|
|
|
|
const store = getStore();
|
|
|
|
|
@@ -87,9 +88,38 @@ export function createMainWindow() {
|
|
|
mainWindow?.hide();
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ ipcMain.on('calling-window', createCallingWindow)
|
|
|
return mainWindow;
|
|
|
}
|
|
|
|
|
|
+export function createCallingWindow(event, msg) {
|
|
|
+ if (callingWindow) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ callingWindow = new BrowserWindow({
|
|
|
+ title: "OpenIM calling -----",
|
|
|
+ icon: join(global.pathConfig.publicPath, "favicon.ico"),
|
|
|
+ modal: true,
|
|
|
+ titleBarStyle: "default",
|
|
|
+ webPreferences: {
|
|
|
+ preload: global.pathConfig.preload,
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ if (process.env.VITE_DEV_SERVER_URL) {
|
|
|
+ // Open devTool if the app is not packaged
|
|
|
+ callingWindow.loadURL(`${url}/#/calling`);
|
|
|
+ } else {
|
|
|
+ callingWindow.loadFile(global.pathConfig.callingHtml);
|
|
|
+ }
|
|
|
+ callingWindow.on('close',()=>{
|
|
|
+ callingWindow = null
|
|
|
+ })
|
|
|
+
|
|
|
+ return callingWindow;
|
|
|
+}
|
|
|
+
|
|
|
export function splashEnd() {
|
|
|
splashWindow?.close();
|
|
|
mainWindow?.show();
|