aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2024-08-10 10:18:30 +0200
committerJan200101 <sentrycraft123@gmail.com>2024-08-10 10:18:30 +0200
commit94714507d6132518a498ee373cfae77153aa3221 (patch)
tree0531dad495f5c3cc8e60cc5ab0c1600615d61d82
parent83cc8a62ca9773bdf194175f6e6c6b80a7795f90 (diff)
downloadViper-94714507d6132518a498ee373cfae77153aa3221.tar.gz
Viper-94714507d6132518a498ee373cfae77153aa3221.zip
chore: prevent gamepath permission alert from reopening on same gamepath
Co-authored-by: 0neGal <mail@0negal.com>
-rw-r--r--src/modules/gamepath.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/gamepath.js b/src/modules/gamepath.js
index 1e1153e..db669c1 100644
--- a/src/modules/gamepath.js
+++ b/src/modules/gamepath.js
@@ -55,8 +55,8 @@ 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) {
+ gamepath.lost_perms = selected_gamepath;
await win().alert(lang("gui.gamepath.lost_perms") + selected_gamepath);
ipcMain.emit("setpath");
}
@@ -167,6 +167,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;