From 0100b295a13138b982888910b6e05e7ad56808a6 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 22 Jul 2021 11:16:07 +0200 Subject: fix crash on selection --- pages/editor.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pages/editor.tsx b/pages/editor.tsx index 115411f..02c69f0 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -483,6 +483,7 @@ function TimelineSelection(props: { selectionDragArea: Ref; }) { if (global.selection.type.left.value) global.selection.type.left.set(null); if (global.selection.type.right.value) global.selection.type.right.set(null); if (global.selection.placed.value) global.selection.placed.set(false); + setSetting('default'); selectionPosAPI.start({ center: 0, startOffset: 0, @@ -539,6 +540,7 @@ function TimelineSelection(props: { selectionDragArea: Ref; }) { ); select(keyframesInSelection); + setSetting('slide'); } } }, { domTarget: props.selectionDragArea, eventOptions: { passive: false } }); @@ -1269,12 +1271,11 @@ function DefaultSettings() { ; } -function SlideProperties(props: { - type: slideTypes; -}) { - if (props.type == 'default') return null; - - var slide = useHookstate(global).selection.slides[0]; +function SlideProperties() { + var selection = useHookstate(global).selection.slides; + if (selection.length < 1) return null; + var slide = selection[0]; + if (slide.value.type == 'default') return null; return
Properties @@ -1313,7 +1314,7 @@ function SlideProperties(props: { , - }[props.type]} + }[slide.value.type]}
; } @@ -1349,7 +1350,7 @@ function SlideSettings() { - {!multipleSlides && } + {!multipleSlides && }
Click through behaviour -- cgit v1.2.3