Initial commit
This commit is contained in:
26
src/main/index.ts
Normal file
26
src/main/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { app, BrowserWindow } from 'electron';
|
||||
import { createMainWindow } from "./mainWindow";
|
||||
import { createSplashWindow } from "./splash";
|
||||
|
||||
function createWindows() {
|
||||
const mainWindow = createMainWindow();
|
||||
const splash = createSplashWindow();
|
||||
|
||||
mainWindow.once("ready-to-show", () => {
|
||||
splash.destroy();
|
||||
mainWindow.show();
|
||||
});
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
createWindows();
|
||||
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) createWindows();
|
||||
});
|
||||
});
|
||||
|
||||
app.on("window-all-closed", () => {
|
||||
if (process.platform !== "darwin")
|
||||
app.quit();
|
||||
});
|
||||
Reference in New Issue
Block a user