Skip to content

Commit

Permalink
Merge pull request #46 from nextcloud-gmbh/fix/noid/dev-prod-instance…
Browse files Browse the repository at this point in the history
…-lock

Fix dev and prod instances lock each other
  • Loading branch information
nickvergessen authored Mar 21, 2023
2 parents 63886a6 + f3f3f31 commit ed427b2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ const { getOs, isLinux } = require('./shared/os.utils.js')
const { setupMenu } = require('./app/app.menu.js')
const { createHelpWindow } = require('./help/help.window.js')

/**
* Separate production and development instances, including application and user data
*/
if (process.env.NODE_ENV === 'development') {
app.setName('Nextcloud Talk (dev)')
app.setPath('userData', path.join(app.getPath('appData'), 'Nextcloud Talk (dev)'))
}

/**
* Only one instance is allowed at time
*/
Expand All @@ -59,12 +67,6 @@ ipcMain.handle('app:enableWebRequestInterceptor', (event, ...args) => enableWebR
ipcMain.handle('app:disableWebRequestInterceptor', (event, ...args) => disableWebRequestInterceptor(...args))
ipcMain.handle('app:setBadgeCount', async (event, count) => app.setBadgeCount(count))

// Separate production and development appData
if (process.env.NODE_ENV === 'development') {
app.setName('Nextcloud Talk (dev)')
app.setPath('userData', path.join(app.getPath('appData'), 'Nextcloud Talk (dev)'))
}

app.whenReady().then(async () => {
if (process.env.NODE_ENV !== 'production') {
await installExtension(VUEJS3_DEVTOOLS)
Expand Down

0 comments on commit ed427b2

Please sign in to comment.