We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c27df9f commit b05f108Copy full SHA for b05f108
src/main.dev.ts
@@ -34,6 +34,22 @@ export default class AppUpdater {
34
35
let mainWindow: BrowserWindow | null = null;
36
37
+const gotTheLock = app.requestSingleInstanceLock();
38
+
39
+if (!gotTheLock) {
40
+ app.quit();
41
+} else {
42
+ app.on('second-instance', () => {
43
+ // Someone tried to run a second instance, we should focus our window.
44
+ if (mainWindow) {
45
+ if (mainWindow.isMinimized()) {
46
+ mainWindow.restore();
47
+ }
48
+ mainWindow.focus();
49
50
+ });
51
+}
52
53
if (process.env.NODE_ENV === 'production') {
54
const sourceMapSupport = require('source-map-support');
55
sourceMapSupport.install();
0 commit comments