aboutsummaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
authorGitExample <git@example.com>2022-02-03 01:36:11 +0100
committerGitExample <git@example.com>2022-02-03 01:36:11 +0100
commita4b11903979fdb4c8b0f6dda8f7343e14c1ebe17 (patch)
tree408def0b839140c6004ba5099c3abf0cc2319bea /src/utils.js
parentd3228ae7fad117a8313731107f572ba4879569b6 (diff)
downloadViper-a4b11903979fdb4c8b0f6dda8f7343e14c1ebe17.tar.gz
Viper-a4b11903979fdb4c8b0f6dda8f7343e14c1ebe17.zip
detection of installed mods, disabling buttons
When a new mod has been installed through the browser UI it's button is changed from "Install" to "Re-Install" instantly. We also now disable modding related buttons when updating NS, or when installing mods. This should prevent issues.
Diffstat (limited to 'src/utils.js')
-rw-r--r--src/utils.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/utils.js b/src/utils.js
index d1cc345..b54808d 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -444,12 +444,15 @@ const mods = {
if (fs.existsSync(path.join(mod, "mod.json")) &&
fs.statSync(path.join(mod, "mod.json")).isFile()) {
- copy.sync(mod, path.join(modpath, mod.replace(/^.*(\\|\/|\:)/, "")), {
+ let modname = mod.replace(/^.*(\\|\/|\:)/, "");
+ copy.sync(mod, path.join(modpath, modname), {
mode: true,
cover: true,
utimes: true,
});
+ ipcMain.emit("installedmod", "", modname);
+
return installed();
} else {
files = fs.readdirSync(mod);