Fix bugs in dropdown loading

This commit is contained in:
the1812 2019-03-28 16:12:29 +08:00
parent a4fdb96768
commit cff8664e24
5 changed files with 45 additions and 25 deletions

View File

@ -1950,11 +1950,15 @@ class ResourceManager
})); }));
} }
} }
await Promise.all(Object.values(Resource.manifest) const manifests = Object.values(Resource.manifest).filter(it => it.dropdown).map(it => it.dropdown);
.concat(Object.values(Resource.all)) Object.values(Resource.all).filter(it => it.dropdown).map(it => it.dropdown).forEach(it =>
.filter(it => it.dropdown) {
.map(it => applyDropdownOption(it.dropdown)) if (!manifests.some(m => m.key === it.key))
); {
manifests.push(it);
}
});
await Promise.all(manifests.map(it => applyDropdownOption(it)));
} }
validateCache() validateCache()
{ {

View File

@ -1950,11 +1950,15 @@ class ResourceManager
})); }));
} }
} }
await Promise.all(Object.values(Resource.manifest) const manifests = Object.values(Resource.manifest).filter(it => it.dropdown).map(it => it.dropdown);
.concat(Object.values(Resource.all)) Object.values(Resource.all).filter(it => it.dropdown).map(it => it.dropdown).forEach(it =>
.filter(it => it.dropdown) {
.map(it => applyDropdownOption(it.dropdown)) if (!manifests.some(m => m.key === it.key))
); {
manifests.push(it);
}
});
await Promise.all(manifests.map(it => applyDropdownOption(it)));
} }
validateCache() validateCache()
{ {

View File

@ -1895,11 +1895,15 @@ class ResourceManager
})); }));
} }
} }
await Promise.all(Object.values(Resource.manifest) const manifests = Object.values(Resource.manifest).filter(it => it.dropdown).map(it => it.dropdown);
.concat(Object.values(Resource.all)) Object.values(Resource.all).filter(it => it.dropdown).map(it => it.dropdown).forEach(it =>
.filter(it => it.dropdown) {
.map(it => applyDropdownOption(it.dropdown)) if (!manifests.some(m => m.key === it.key))
); {
manifests.push(it);
}
});
await Promise.all(manifests.map(it => applyDropdownOption(it)));
} }
validateCache() validateCache()
{ {

View File

@ -1895,11 +1895,15 @@ class ResourceManager
})); }));
} }
} }
await Promise.all(Object.values(Resource.manifest) const manifests = Object.values(Resource.manifest).filter(it => it.dropdown).map(it => it.dropdown);
.concat(Object.values(Resource.all)) Object.values(Resource.all).filter(it => it.dropdown).map(it => it.dropdown).forEach(it =>
.filter(it => it.dropdown) {
.map(it => applyDropdownOption(it.dropdown)) if (!manifests.some(m => m.key === it.key))
); {
manifests.push(it);
}
});
await Promise.all(manifests.map(it => applyDropdownOption(it)));
} }
validateCache() validateCache()
{ {

View File

@ -249,11 +249,15 @@ export class ResourceManager
})); }));
} }
} }
await Promise.all(Object.values(Resource.manifest) const manifests = Object.values(Resource.manifest).filter(it => it.dropdown).map(it => it.dropdown);
.concat(Object.values(Resource.all)) Object.values(Resource.all).filter(it => it.dropdown).map(it => it.dropdown).forEach(it =>
.filter(it => it.dropdown) {
.map(it => applyDropdownOption(it.dropdown)) if (!manifests.some(m => m.key === it.key))
); {
manifests.push(it);
}
});
await Promise.all(manifests.map(it => applyDropdownOption(it)));
} }
validateCache() validateCache()
{ {