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:
lilia 2017-04-25 20:16:51 -07:00 committed by Scott Nonnenberg
parent 38b292ef9e
commit c2014b062d
No known key found for this signature in database
GPG Key ID: A4931C09644C654B
1 changed files with 2 additions and 1 deletions

View File

@ -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) {