diff options
author | GitExample <git@example.com> | 2022-02-05 17:26:23 +0100 |
---|---|---|
committer | GitExample <git@example.com> | 2022-02-05 17:26:23 +0100 |
commit | 03a9237fd1552856c6b83d0cf7fa76c7db1a1e29 (patch) | |
tree | da41612ca975e246baabf0beca0987c71be23830 /src | |
parent | 651c0b32d37dd03c581dc5c9cac8ec293816a636 (diff) | |
download | Viper-03a9237fd1552856c6b83d0cf7fa76c7db1a1e29.tar.gz Viper-03a9237fd1552856c6b83d0cf7fa76c7db1a1e29.zip |
fix mod list updating properly
A setInterval() will do the job, it's not performant, and I'll have a
look at improving this further down the line to something better.
Diffstat (limited to 'src')
-rw-r--r-- | src/utils.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/utils.js b/src/utils.js index 39e86be..6c24aff 100644 --- a/src/utils.js +++ b/src/utils.js @@ -349,7 +349,7 @@ const mods = { try { mods.push({...require(path.join(modpath, file, "mod.json")), FolderName: file, Disabled: false}) }catch(err) { - console.log("error: " + lang("cli.mods.improperjson"), file) + if (cli.hasArgs()) {console.log("error: " + lang("cli.mods.improperjson"), file)} mods.push({Name: file, FolderName: file, Version: "unknown", Disabled: false}) } } @@ -368,7 +368,7 @@ const mods = { try { disabled.push({...require(path.join(disabledPath, file, "mod.json")), FolderName: file, Disabled: true}) }catch(err) { - console.log("error: " + lang("cli.mods.improperjson"), file) + if (cli.hasArgs()) {console.log("error: " + lang("cli.mods.improperjson"), file)} disabled.push({Name: file, FolderName: file, Version: "unknown", Disabled: true}) } } @@ -646,6 +646,10 @@ const mods = { } }; +setInterval(() => { + ipcMain.emit("guigetmods"); +}, 1500) + module.exports = { mods, lang, |