show error message when preload can't build movies
Not sure why movie clip building is failing! But it happened outside our try-catch, so it left us in an infinite spinner state. The repro item is the Spring Topiary Garden Background!
This commit is contained in:
parent
9f692b02b8
commit
0387a78574
1 changed files with 17 additions and 6 deletions
|
@ -340,13 +340,24 @@ export function usePreloadLayers(layers) {
|
|||
|
||||
if (canceled) return;
|
||||
|
||||
const newLayersHaveAnimations = assets.some(
|
||||
(a) =>
|
||||
a.type === "movie" &&
|
||||
hasAnimations(buildMovieClip(a.library, a.libraryUrl))
|
||||
);
|
||||
let movieClips;
|
||||
try {
|
||||
movieClips = assets
|
||||
.filter((a) => a.type === "movie")
|
||||
.map((a) => buildMovieClip(a.library, a.libraryUrl));
|
||||
} catch (e) {
|
||||
console.error("Error building movie clips", e);
|
||||
assetPromises.forEach((p) => {
|
||||
if (p.cancel) {
|
||||
p.cancel();
|
||||
}
|
||||
});
|
||||
setError(e);
|
||||
return;
|
||||
}
|
||||
|
||||
setLayersHaveAnimations(movieClips.some(hasAnimations));
|
||||
setLoadedLayers(layers);
|
||||
setLayersHaveAnimations(newLayersHaveAnimations);
|
||||
};
|
||||
|
||||
loadAssets();
|
||||
|
|
Loading…
Reference in a new issue