fix(lib/assets/patches): immediately cache assets without waiting
This commit is contained in:
parent
ede2a582a0
commit
28e1929ee9
1 changed files with 10 additions and 12 deletions
|
|
@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue