flat: 暂存
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
import { app, shell, BrowserWindow } from "electron";
|
||||
import { setupLiveHandlers } from "./ipc/live";
|
||||
import { setupPromptHandlers } from "./ipc/prompt";
|
||||
import { setupWorkflowHandlers } from "./ipc/workflow";
|
||||
import { preload, indexHtml, ELECTRON_RENDERER_URL } from "./config";
|
||||
|
||||
// 必须在 app ready 之前调用
|
||||
app.commandLine.appendSwitch("disable-site-isolation-trials");
|
||||
|
||||
app.commandLine.appendSwitch(
|
||||
"disable-features",
|
||||
"IsolateOrigins,site-per-process",
|
||||
);
|
||||
|
||||
// 简单的开发环境检测
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
const isDev = process.env.NODE_ENV === "development";
|
||||
|
||||
/**
|
||||
* 创建主窗口
|
||||
@@ -15,6 +22,7 @@ function createWindow(): void {
|
||||
width: 1080,
|
||||
height: 670,
|
||||
show: false,
|
||||
titleBarStyle: "hidden",
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
preload,
|
||||
@@ -59,8 +67,6 @@ app.whenReady().then(() => {
|
||||
// 直播相关处理
|
||||
setupLiveHandlers();
|
||||
|
||||
setupPromptHandlers();
|
||||
|
||||
setupWorkflowHandlers();
|
||||
|
||||
createWindow();
|
||||
@@ -84,7 +90,7 @@ app.on("window-all-closed", () => {
|
||||
app.on("before-quit", () => {
|
||||
// 清理所有资源
|
||||
const windows = BrowserWindow.getAllWindows();
|
||||
windows.forEach(window => {
|
||||
windows.forEach((window) => {
|
||||
window.removeAllListeners();
|
||||
window.close();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user