From 0fe3b31816a7acaad974ebdd4d15e7aa5a7a8486 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 23 Jun 2021 10:34:49 +0200 Subject: smol fixes from zustand-to-hookstate branch --- pages/editor.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pages/editor.tsx b/pages/editor.tsx index a6c8547..f00c504 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -67,7 +67,7 @@ var project = createState({ playing: false, frame: 0, labels: [], - zoom: 0.687077725615, + zoom: 0.687077725616, workingTimeline: [], tool: 'cursor', }, @@ -114,13 +114,11 @@ function TimelineKeyframe(props: { slide: slide; }) { var workingTimeline = useHookstate(project).timeline.workingTimeline; - var setWorkingTimeline = useHookstate(project).timeline.workingTimeline.set; var updateTimeline = useHookstate(project).update.refreshLiveTimeline.value; function modifySlide(newProps: Partial) { - var slide = workingTimeline.value.find(s => s.id == props.slide.id); - slide = Object.assign(slide, newProps); - setWorkingTimeline(workingTimeline.value); + var slide = workingTimeline.find(s => s.value.id == props.slide.id); + slide.set(Object.assign(slide.value, newProps)); } var dragRef = useRef(null); @@ -203,7 +201,7 @@ function TimelineKeyframe(props: { var mouseUpListener = useRef(null); useDrag(({ last }) => { if (!last) return; - updateTimeline(); + project.update.refreshLiveTimeline.value(); }, { domTarget: mouseUpListener, eventOptions: { passive: false } }); return

Presentation settings

@@ -670,8 +670,8 @@ function DefaultSettings() {