Allow multi-instance in development
This commit is contained in:
parent
0c9cca08ba
commit
c1fa33327d
1 changed files with 16 additions and 14 deletions
8
main.js
8
main.js
|
@ -12,6 +12,10 @@ const shell = electron.shell;
|
|||
|
||||
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') {
|
||||
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
|
||||
// Someone tried to run a second instance, we should focus our window
|
||||
if (mainWindow) {
|
||||
|
@ -25,9 +29,7 @@ if (shouldQuit) {
|
|||
app.quit();
|
||||
return;
|
||||
}
|
||||
|
||||
const package_json = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf-8'))
|
||||
const environment = package_json.environment || process.env.NODE_ENV || 'development';
|
||||
}
|
||||
|
||||
// Set environment vars to configure node-config before requiring it
|
||||
process.env.NODE_ENV = environment;
|
||||
|
|
Loading…
Add table
Reference in a new issue