Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jijojosephk committed Jul 9, 2023
1 parent b3bc553 commit d6d52d7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/mainAppWindow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,16 +338,18 @@ function secureOpenLink(details) {

function openInBrowser(details) {
if (config.defaultURLHandler.trim() !== '') {
exec(`${config.defaultURLHandler.trim()} ${details.url}`, (error) => {
if (error) {
logger.error(error.message);
}
});
exec(`${config.defaultURLHandler.trim()} ${details.url}`, openInBrowserErrorHandler);
} else {
shell.openExternal(details.url);
}
}

function openInBrowserErrorHandler(error) {
if (error) {
logger.error(error.message);
}
}

function getLinkAction() {
const action = isControlPressed ? dialog.showMessageBoxSync(window, {
type: 'warning',
Expand Down

0 comments on commit d6d52d7

Please sign in to comment.