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:
Emi Matchu 2020-10-10 02:37:37 -07:00
parent f6268810be
commit 68607e3756

View file

@ -341,7 +341,11 @@ export function usePreloadLayers(layers) {
} catch (e) {
if (canceled) return;
console.error("Error preloading outfit layers", e);
assetPromises.forEach((p) => p.cancel());
assetPromises.forEach((p) => {
if (p.cancel) {
p.cancel();
}
});
setError(e);
return;
}