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;
|
||||
|
||||
if (!app.requestSingleInstanceLock()) {
|
||||
console.log("Vencord Desktop is already running. Quitting...");
|
||||
app.quit();
|
||||
} else {
|
||||
app.on("second-instance", () => {
|
||||
if (mainWin) {
|
||||
function init() {
|
||||
app.on("second-instance", (_event, _cmdLine, _cwd, data: any) => {
|
||||
if (data.IS_DEV) app.quit();
|
||||
else if (mainWin) {
|
||||
if (mainWin.isMinimized()) mainWin.restore();
|
||||
if (!mainWin.isVisible()) mainWin.show();
|
||||
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() {
|
||||
const splash = createSplashWindow();
|
||||
|
||||
|
|
Loading…
Reference in a new issue