From 78a7dcb7e8f60a992b2b9c9e39a7a45147966b1b Mon Sep 17 00:00:00 2001 From: Araxeus Date: Mon, 10 May 2021 23:46:56 +0300 Subject: [PATCH] lint --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 399c8a3f..851b26f9 100644 --- a/index.js +++ b/index.js @@ -263,12 +263,12 @@ app.on("ready", () => { try { // check if shortcut is registered and valid const shortcutDetails = electron.shell.readShortcutLink(shortcutPath); // throw error if doesn't exist yet if (shortcutDetails.target !== appLocation || shortcutDetails.appUserModelId !== appID) { - throw undefined; + throw "needUpdate"; } - } catch { // if not valid -> Register shortcut + } catch (error) { // if not valid -> Register shortcut electron.shell.writeShortcutLink( shortcutPath, - "create", + error === "needUpdate" ? "update" : "create", { target: appLocation, cwd: appLocation.slice(0, appLocation.lastIndexOf(path.sep)),