Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Oct 17, 2023
1 parent 3359de7 commit 628176e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/desktop/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,12 @@ ipcMain.handle('get-machine-id', (_e) => getMachineId())
ipcMain.handle('update-app-settings', (_e, settings) => updateSettings(settings))
ipcMain.handle('update-theme', (_e, theme) => (nativeTheme.themeSource = theme))

const argWithAppProtocol = (arg) => arg.startsWith(`${process.env.APP_PROTOCOL}://`)

/**
* Define deep link state
*/
let deepLinkUrl = process.argv[1]
let deepLinkUrl = process.args.find(argWithAppProtocol)

/**
* Create a single instance only
Expand All @@ -472,7 +474,7 @@ if (!isFirstInstance) {
app.on('second-instance', (_e, args) => {
if (windows.main) {
if (args.length > 1) {
const params = args.find((arg) => arg.startsWith(`${process.env.APP_PROTOCOL}://`))
const params = args.find(argWithAppProtocol)

if (params) {
windows.main.webContents.send('deep-link-params', params)
Expand Down

0 comments on commit 628176e

Please sign in to comment.