[WIP] Fix bug loading movies
This was a fun journey! Turns out Next 12 is using a new faster JS compiler called SWC, which had a compiler bug that triggered here! The incorrect looping behavior caused `libraryUrl` to sometimes be `null` by the time the movie promise completes, because `layer` was set to whatever the `last` layer in the list had been. https://github.com/swc-project/swc/issues/2624 Anyway, turns out this code has been through a few refactors, and the `async` function wrapper is extraneous now! So I've just deleted it and inlined its code. Ta da! lol
This commit is contained in:
parent
4af2719098
commit
7fd85e5e2a
1 changed files with 66 additions and 70 deletions
|
@ -388,7 +388,6 @@ export function usePreloadLayers(layers) {
|
||||||
setError(null);
|
setError(null);
|
||||||
setLayersHaveAnimations(false);
|
setLayersHaveAnimations(false);
|
||||||
|
|
||||||
const loadAssets = async () => {
|
|
||||||
const minimalAssetPromises = [];
|
const minimalAssetPromises = [];
|
||||||
const imageAssetPromises = [];
|
const imageAssetPromises = [];
|
||||||
const movieAssetPromises = [];
|
const movieAssetPromises = [];
|
||||||
|
@ -462,9 +461,6 @@ export function usePreloadLayers(layers) {
|
||||||
console.error(`Error preloading movie library ${p.libraryUrl}:`, e);
|
console.error(`Error preloading movie library ${p.libraryUrl}:`, e);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
||||||
loadAssets();
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
canceled = true;
|
canceled = true;
|
||||||
|
|
Loading…
Reference in a new issue