From d6d52d714e79c905fd880faa7d55a8300b377926 Mon Sep 17 00:00:00 2001 From: Jijo Joseph Date: Sun, 9 Jul 2023 09:54:33 +0530 Subject: [PATCH] Code refactoring --- app/mainAppWindow/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/mainAppWindow/index.js b/app/mainAppWindow/index.js index 207729a8..6da1ccc5 100644 --- a/app/mainAppWindow/index.js +++ b/app/mainAppWindow/index.js @@ -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',