Skip to content

Commit

Permalink
chore: prevent gamepath permission alert from reopening on same gamepath
Browse files Browse the repository at this point in the history
Co-authored-by: 0neGal <mail@0negal.com>
  • Loading branch information
Jan200101 and 0neGal committed Aug 5, 2024
1 parent 83cc8a6 commit 97ce139
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/gamepath.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ ipcMain.on("missing-perms", async (e, selected_gamepath) => {
})

ipcMain.on("gamepath-lost-perms", async (e, selected_gamepath) => {
if (! gamepath.setting) {
gamepath.setting = true;
if (! gamepath.setting && gamepath.lost_perms != selected_gamepath) {
console.log(gamepath.lost_perms);
gamepath.lost_perms = selected_gamepath;
await win().alert(lang("gui.gamepath.lost_perms") + selected_gamepath);
ipcMain.emit("setpath");
}
Expand Down Expand Up @@ -167,6 +168,8 @@ gamepath.set = async (win, force_dialog) => {
return gamepath.setting = false;
}

delete gamepath.lost_perms;

if (! fs.existsSync(path.join(res.filePaths[0], "Titanfall2.exe"))) {
ipcMain.emit("wrong-path");
return gamepath.setting = false;
Expand Down

0 comments on commit 97ce139

Please sign in to comment.