From 68607e37561534b510d408a6f66f2d7f60e00b82 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 10 Oct 2020 02:37:37 -0700 Subject: [PATCH] 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. --- src/app/components/OutfitPreview.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/components/OutfitPreview.js b/src/app/components/OutfitPreview.js index 14e6055..f6d4b08 100644 --- a/src/app/components/OutfitPreview.js +++ b/src/app/components/OutfitPreview.js @@ -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; }