Skip to content

Commit cb6a5a4

Browse files
committed
lint
1 parent d615030 commit cb6a5a4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,13 @@ app.on("ready", () => {
257257

258258
// Register appID on windows
259259
if (is.windows()) {
260-
const appLocation = process.execPath;
261260
const appID = "com.github.th-ch.youtube-music";
262261
app.setAppUserModelId(appID);
262+
const appLocation = process.execPath;
263+
const appData = app.getPath("appData");
263264
// check shortcut validity if not in dev mode / running portable app
264-
if (!is.dev() && !appLocation.startsWith(path.join(app.getPath("appData"), "..", "Local", "Temp"))) {
265-
const shortcutPath = path.join(app.getPath("appData"), "Microsoft", "Windows", "Start Menu", "Programs", "YouTube Music.lnk");
265+
if (!is.dev() && !appLocation.startsWith(path.join(appData, "..", "Local", "Temp"))) {
266+
const shortcutPath = path.join(appData, "Microsoft", "Windows", "Start Menu", "Programs", "YouTube Music.lnk");
266267
try { // check if shortcut is registered and valid
267268
const shortcutDetails = electron.shell.readShortcutLink(shortcutPath); // throw error if doesn't exist yet
268269
if (shortcutDetails.target !== appLocation || shortcutDetails.appUserModelId !== appID) {

0 commit comments

Comments
 (0)