Skip to content

Commit

Permalink
Add singleton instance lock
Browse files Browse the repository at this point in the history
  • Loading branch information
everoddandeven committed Oct 17, 2024
1 parent 79cc8dc commit 8b2337e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ interface Stats {
//import * as bz2 from 'unbzip2-stream';
const bz2 = require('unbzip2-stream');

const gotInstanceLock = app.requestSingleInstanceLock();

if (!gotInstanceLock) {
dialog.showErrorBox('Error', 'Another instance of monerod GUI is running');
app.quit();
}


let win: BrowserWindow | null = null;
let isHidden: boolean = false;
let isQuitting: boolean = false;
Expand Down Expand Up @@ -108,7 +116,8 @@ function createWindow(): BrowserWindow {
nodeIntegration: false,
allowRunningInsecureContent: (serve),
contextIsolation: true,
devTools: !app.isPackaged
devTools: !app.isPackaged,
sandbox: false
},
autoHideMenuBar: true,
icon: wdwIcon
Expand Down

0 comments on commit 8b2337e

Please sign in to comment.