Oops, don't crash if animation image fails
Whoops, `Promise.race` isn't quite what I wanted here. This meant that, if the image promise _fails_ before the movie _succeeds_, the outfit would crash even though it doesn't need to. (And this was happening too often, due to a bug in /api/assetImage!) Now, we accept whichever _successful_ result loads first, or reject if they _both_ fail. I tested this by having /api/assetImage always throw, and confirmed that it crashed the outfit before this change, and no longer does after this change!
This commit is contained in:
parent
fc52439387
commit
781034a568
1 changed files with 1 additions and 1 deletions
|
@ -417,7 +417,7 @@ export function usePreloadLayers(layers) {
|
||||||
// The minimal asset for the movie case is *either* the image *or*
|
// The minimal asset for the movie case is *either* the image *or*
|
||||||
// the movie, because we can start rendering when either is ready.
|
// the movie, because we can start rendering when either is ready.
|
||||||
minimalAssetPromises.push(
|
minimalAssetPromises.push(
|
||||||
Promise.race([imageAssetPromise, movieAssetPromise])
|
Promise.any([imageAssetPromise, movieAssetPromise])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
minimalAssetPromises.push(imageAssetPromise);
|
minimalAssetPromises.push(imageAssetPromise);
|
||||||
|
|
Loading…
Reference in a new issue