fix infinite spinner on err loading HTML5 layers
Oops, our movie layer promises don't have a .cancel() method, so calling it crashed our error handler. Now, when there's an error loading a layer and there are HTML5 layers visible, we'll correctly show the "Could not load preview. Try again?" message.
This commit is contained in:
parent
f6268810be
commit
68607e3756
1 changed files with 5 additions and 1 deletions
|
@ -341,7 +341,11 @@ export function usePreloadLayers(layers) {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
console.error("Error preloading outfit layers", e);
|
console.error("Error preloading outfit layers", e);
|
||||||
assetPromises.forEach((p) => p.cancel());
|
assetPromises.forEach((p) => {
|
||||||
|
if (p.cancel) {
|
||||||
|
p.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
setError(e);
|
setError(e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue