Make IS_DEV force new instance
This commit is contained in:
parent
d0e7a319d6
commit
7a2161d746
1 changed files with 16 additions and 6 deletions
|
@ -28,12 +28,10 @@ const runVencordMain = once(() => require(join(VENCORD_FILES_DIR, "vencordDeskto
|
||||||
|
|
||||||
let mainWin: BrowserWindow | null = null;
|
let mainWin: BrowserWindow | null = null;
|
||||||
|
|
||||||
if (!app.requestSingleInstanceLock()) {
|
function init() {
|
||||||
console.log("Vencord Desktop is already running. Quitting...");
|
app.on("second-instance", (_event, _cmdLine, _cwd, data: any) => {
|
||||||
app.quit();
|
if (data.IS_DEV) app.quit();
|
||||||
} else {
|
else if (mainWin) {
|
||||||
app.on("second-instance", () => {
|
|
||||||
if (mainWin) {
|
|
||||||
if (mainWin.isMinimized()) mainWin.restore();
|
if (mainWin.isMinimized()) mainWin.restore();
|
||||||
if (!mainWin.isVisible()) mainWin.show();
|
if (!mainWin.isVisible()) mainWin.show();
|
||||||
mainWin.focus();
|
mainWin.focus();
|
||||||
|
@ -53,6 +51,18 @@ if (!app.requestSingleInstanceLock()) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!app.requestSingleInstanceLock({ IS_DEV })) {
|
||||||
|
if (IS_DEV) {
|
||||||
|
console.log("Vencord Desktop is already running. Quitting previous instance...");
|
||||||
|
init();
|
||||||
|
} else {
|
||||||
|
console.log("Vencord Desktop is already running. Quitting...");
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
async function createWindows() {
|
async function createWindows() {
|
||||||
const splash = createSplashWindow();
|
const splash = createSplashWindow();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue