Don't makeSingleInstance in a MAS build
It seems that makeSingleInstance will always return true in the MAS build.* Luckily, OSX mostly enforces single-instance for us when opening the app from Finder. If the user attempts to run a second instance from the command line, it will create a window but fail to load. *TODO: Revisit why makeSingleInstance is broken in the MAS build. // FREEBIE
This commit is contained in:
parent
38b292ef9e
commit
c2014b062d
1 changed files with 2 additions and 1 deletions
3
main.js
3
main.js
|
@ -15,7 +15,8 @@ app.setAppUserModelId('org.whispersystems.signal-desktop')
|
|||
const package_json = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf-8'))
|
||||
const environment = package_json.environment || process.env.NODE_ENV || 'development';
|
||||
|
||||
if (environment === 'production') {
|
||||
if (environment === 'production' && !process.mas) {
|
||||
console.log('making app single instance');
|
||||
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
|
||||
// Someone tried to run a second instance, we should focus our window
|
||||
if (mainWindow) {
|
||||
|
|
Loading…
Add table
Reference in a new issue