Skip to content

Commit

Permalink
Fix deeplink open from cold start
Browse files Browse the repository at this point in the history
  • Loading branch information
OKendigelyan committed Jan 13, 2025
1 parent fe19226 commit 627fbd2
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions apps/desktop/public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,14 @@ function createWindow() {
}

function start() {
app.on("open-url", (_event, url) => {
if (mainWindow) {
mainWindow.webContents.send("deeplinkURL", url);
} else {
deeplinkURL = url;
}
});

// Assure single instance
if (!app.requestSingleInstanceLock()) {
app.quit();
Expand Down Expand Up @@ -370,15 +378,6 @@ function start() {
}
});

app.on("open-url", (_event, url) => {
if (mainWindow) {
mainWindow.webContents.send("deeplinkURL", url);
} else {
deeplinkURL = url;
app.whenReady().then(createWindow);
}
});

// This method will be called when Electron has finished its initialization and
// is ready to create the browser windows.
// Some APIs can only be used after this event occurs.
Expand Down

0 comments on commit 627fbd2

Please sign in to comment.