From b684c6d58295ecf00be600f7e45d66f66ddb0fbd Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Tue, 28 May 2024 16:42:02 -0400 Subject: [PATCH] fixup! refactor: Store startPoint, waypoints, and endPoint as separate pieces of context --- assets/src/hooks/useDetour.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/assets/src/hooks/useDetour.ts b/assets/src/hooks/useDetour.ts index 6be47579cb..3e9783e785 100644 --- a/assets/src/hooks/useDetour.ts +++ b/assets/src/hooks/useDetour.ts @@ -29,10 +29,7 @@ export enum DetourState { export const useDetour = ({ routePatternId, shape }: OriginalRoute) => { const [snapshot, send] = useMachine(createDetourMachine) - const startPoint = snapshot.context.startPoint - const endPoint = snapshot.context.endPoint - /** The detour waypoints in-between the start and end point */ - const waypoints = snapshot.context.waypoints + const { startPoint, endPoint, waypoints } = snapshot.context const allPoints = useMemo(() => { if (!startPoint) { return []