From cb6a5a478eafab5104200bbfc56c4d9ee7bfca60 Mon Sep 17 00:00:00 2001 From: Araxeus Date: Tue, 11 May 2021 16:47:51 +0300 Subject: [PATCH] lint --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 4c33d750..83f8d59f 100644 --- a/index.js +++ b/index.js @@ -257,12 +257,13 @@ app.on("ready", () => { // Register appID on windows if (is.windows()) { - const appLocation = process.execPath; const appID = "com.github.th-ch.youtube-music"; app.setAppUserModelId(appID); + const appLocation = process.execPath; + const appData = app.getPath("appData"); // check shortcut validity if not in dev mode / running portable app - if (!is.dev() && !appLocation.startsWith(path.join(app.getPath("appData"), "..", "Local", "Temp"))) { - const shortcutPath = path.join(app.getPath("appData"), "Microsoft", "Windows", "Start Menu", "Programs", "YouTube Music.lnk"); + if (!is.dev() && !appLocation.startsWith(path.join(appData, "..", "Local", "Temp"))) { + const shortcutPath = path.join(appData, "Microsoft", "Windows", "Start Menu", "Programs", "YouTube Music.lnk"); 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) {