curse: fixed callback if no mods are in the config

This commit is contained in:
2021-01-20 13:47:12 +01:00
parent f60f2eb376
commit 0b6fc9174e

View File

@ -5,6 +5,7 @@ function main() {
let downloadStarted = false;
let dep = new Map();
mods_lock = new Map(Object.entries(mods_lock));
if(global.config.mods.curse.length === 0) globCallback("curse", {});
global.config.mods.curse.forEach(mod => {
getData(`search?categoryId=0&gameId=432&gameVersion=${encodeURI(global.config.gameVersion)}&index=0&pageSize=1&searchFilter=${encodeURI(mod)}&sectionId=6&sort=0`, (result) => { // resolve projectID
resolveDep(result[0].id, downloadMods);
@ -63,7 +64,7 @@ function main() {
function downloadMods() {
if(!downloadStarted) {
downloadStarted = true;
globCallback(Object.fromEntries(dep));
globCallback("curse", Object.fromEntries(dep));
dep.forEach((mod, modId) => {
let path = getPath(mod)
if(mods_lock.has(modId)) {