fix(lib/assets/patches): immediately cache assets without waiting

This commit is contained in:
PalmDevs 2025-04-30 18:54:15 +07:00
parent ede2a582a0
commit 28e1929ee9
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -32,18 +32,16 @@ const unsubForAssetRegistry = waitForModules(byProps('registerAsset'), (arId, ex
unsubForAssetRegistry()
setImmediate(() => {
// TODO(assets/patches): conditionally run this if cache does not exist
if (true) {
// More fragile way, but more performant:
// There is exactly one asset before the reexported asset registry, thanks Discord!
const firstAssetModuleId = arId - 1
for (const id of _mUninited) {
if (id < firstAssetModuleId) continue
// TODO(assets/patches): conditionally run this if cache does not exist
if (true) {
// More fragile way, but more performant:
// There is exactly one asset before the reexported asset registry, thanks Discord!
const firstAssetModuleId = arId - 1
for (const id of _mUninited) {
if (id < firstAssetModuleId) continue
const deps = getModuleDependencies(id)!
if (deps.length === 1 && deps[0] === arId) __r(id)
}
const deps = getModuleDependencies(id)!
if (deps.length === 1 && deps[0] === arId) __r(id)
}
})
}
})