Skip to content

Commit 0874721

Browse files
authoredMay 12, 2018
Merge pull request #102 from electron/new-single-instance
new requestSingleInstanceLock api
2 parents 2047486 + dc2f363 commit 0874721

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed
 

‎test-smoke/electron/test/main.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,9 @@ app.on("window-all-closed", () => {
4545
});
4646

4747
// Check single instance app
48-
const shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
49-
// Someone tried to run a second instance, we should focus our window
50-
if (mainWindow) {
51-
if (mainWindow.isMinimized()) mainWindow.restore();
52-
mainWindow.focus();
53-
}
54-
});
48+
const gotLock = app.requestSingleInstanceLock();
5549

56-
if (shouldQuit) {
50+
if (!gotLock) {
5751
app.quit();
5852
process.exit(0);
5953
}

‎vendor/fetch-docs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const mkdirp = require('mkdirp').sync
77
const os = require('os')
88

99
const downloadPath = path.join(os.tmpdir(), 'electron-api-tmp')
10-
const ELECTRON_COMMIT = '35e90f742b8a2f1006157da2a9f394cd055aff74'
10+
const ELECTRON_COMMIT = 'bbba9ff906fce768b258569e84652bf1487338fa'
1111

1212
rm(downloadPath)
1313

0 commit comments

Comments
 (0)
Please sign in to comment.