safely ignore unknown directions
This commit is contained in:
parent
bfc364fe4b
commit
50b9883f99
2 changed files with 9 additions and 6 deletions
|
@ -469,10 +469,11 @@ async function processScrolls(svg: XMLDocument): Promise<VideoScrollDef[]> {
|
|||
direction as VideoScrollDirection
|
||||
)
|
||||
) {
|
||||
throw new Error(`Unknown direction string: "${direction}"`);
|
||||
console.error(`Unknown direction definition: "${direction}"`);
|
||||
return false;
|
||||
}
|
||||
return direction as VideoScrollDirection;
|
||||
});
|
||||
}).filter((d) => Boolean(d)) as VideoScrollDirection[];
|
||||
|
||||
console.debug(`[SVG/VIDEOSCROLLS] Fetching ${filesURL}...`);
|
||||
const fileFetch = await fetch(`content/${filesURL}`);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="video-scroll" ref="root">
|
||||
<div class="video-scroll" ref="root" v-if="definition.directions.length > 0">
|
||||
<img class="visible displayed loaded"
|
||||
:src="definition.files[0]"
|
||||
:style="{
|
||||
|
@ -93,10 +93,12 @@ export default defineComponent({
|
|||
}
|
||||
});
|
||||
});
|
||||
if (this.$refs.root){
|
||||
Array.from((this.$refs.root as Element).children).forEach((el) => {
|
||||
observer.observe(el);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export enum VideoScrollDirection {
|
||||
|
|
Loading…
Reference in a new issue