Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
ident
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev4lexG committed Apr 4, 2023
1 parent 51b4e26 commit 1181ff4
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions src/assets/js/windows/mainWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,53 @@
* @license CC-BY-NC 4.0 - https://creativecommons.org/licenses/by-nc/4.0/
*/

"use strict";
const electron = require("electron");
const path = require("path");
const os = require("os");
const pkg = require("../../../../package.json");
let mainWindow = undefined;
'use strict'
const electron = require('electron')
const path = require('path')
const os = require('os')
const pkg = require('../../../../package.json')
let mainWindow = undefined

function getWindow() {
return mainWindow;
return mainWindow
}

function destroyWindow() {
if (!mainWindow) return;
mainWindow.close();
mainWindow = undefined;
if (!mainWindow) return
mainWindow.close()
mainWindow = undefined
}

function createWindow() {
destroyWindow();
mainWindow = new electron.BrowserWindow({
title: pkg.preductname,
width: 1280,
height: 720,
minWidth: 980,
minHeight: 552,
resizable: true,
icon: `./src/assets/images/icon.${os.platform() === "win32" ? "ico" : "png"}`,
transparent: os.platform() === 'win32',
frame: os.platform() !== 'win32',
show: false,
webPreferences: {
contextIsolation: false,
nodeIntegration: true
},
});
electron.Menu.setApplicationMenu(null);
mainWindow.setMenuBarVisibility(false);
mainWindow.loadFile(path.join(electron.app.getAppPath(), 'src', 'launcher.html'));
mainWindow.once('ready-to-show', () => {
if (mainWindow) {
mainWindow.show();
}
});
destroyWindow()
mainWindow = new electron.BrowserWindow({
title: pkg.preductname,
width: 1280,
height: 720,
minWidth: 980,
minHeight: 552,
resizable: true,
icon: `./src/assets/images/icon.${os.platform() === 'win32' ? 'ico' : 'png'}`,
transparent: os.platform() === 'win32',
frame: os.platform() !== 'win32',
show: false,
webPreferences: {
contextIsolation: false,
nodeIntegration: true,
},
})
electron.Menu.setApplicationMenu(null)
mainWindow.setMenuBarVisibility(false)
mainWindow.loadFile(path.join(electron.app.getAppPath(), 'src', 'launcher.html'))
mainWindow.once('ready-to-show', () => {
if (mainWindow) {
mainWindow.show()
}
})
}

module.exports = {
getWindow,
createWindow,
destroyWindow,
};
getWindow,
createWindow,
destroyWindow,
}

0 comments on commit 1181ff4

Please sign in to comment.