Skip to content

Commit

Permalink
fix(web): page time not updated when switch story page (#1147)
Browse files Browse the repository at this point in the history
  • Loading branch information
airslice authored Sep 18, 2024
1 parent 150e6f5 commit 08d5d27
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions web/src/beta/features/Visualizer/Crust/StoryPanel/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ export default (
return visualizer?.current?.timeline?.current?.commit({
cmd: "SET_TIME",
payload: {
start:
visualizer?.current?.timeline?.current?.computedTimeline?.start,
start: time,
current: time,
stop: visualizer?.current?.timeline?.current?.computedTimeline?.stop
stop: time
},
committer: { source: "storyPage", id: currentPageId }
});
Expand All @@ -120,11 +119,9 @@ export default (

const handlePageTime = useCallback(
(page: StoryPage) => {
const timePointField = page.property?.timePoint;
if (!timePointField?.timePoint?.value) return;
return onTimeChange?.(
new Date(formatISO8601(timePointField?.timePoint?.value) ?? "")
);
const time = page.property?.timePoint?.timePoint;
if (!time) return;
onTimeChange?.(new Date(formatISO8601(time)));
},
[onTimeChange]
);
Expand Down

0 comments on commit 08d5d27

Please sign in to comment.