Skip to content

Commit

Permalink
fix regression
Browse files Browse the repository at this point in the history
(trying to launch a second instance wouldn't have focused main window)
  • Loading branch information
OothecaPickle committed Dec 5, 2024
1 parent 647b1a5 commit d2b6e60
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,14 @@ function runApp() {
// Someone tried to run a second instance, we should focus our window
if (typeof commandLine !== 'undefined') {
const url = getLinkUrl(commandLine)
if (url) {
if (mainWindow && mainWindow.webContents) {
if (mainWindow.isMinimized()) mainWindow.restore()
mainWindow.focus()

mainWindow.webContents.send(IpcChannels.OPEN_URL, url)
} else {
startupUrl = url
createWindow()
}
if (mainWindow && mainWindow.webContents) {
if (mainWindow.isMinimized()) mainWindow.restore()
mainWindow.focus()

if (url) mainWindow.webContents.send(IpcChannels.OPEN_URL, url)
} else {
if (url) startupUrl = url
createWindow()
}
}
})
Expand Down

0 comments on commit d2b6e60

Please sign in to comment.