Skip to content

Commit

Permalink
wip! add fullstory events for waypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
firestack committed Oct 21, 2024
1 parent 73c31c1 commit b5dac4c
Showing 1 changed file with 34 additions and 18 deletions.
52 changes: 34 additions & 18 deletions assets/src/models/createDetourMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
fetchRoutePatterns,
} from "../api"
import { DetourShape, FinishedDetour } from "./detour"
import { fullStoryEvent } from "../helpers/fullStory"

export const createDetourMachine = setup({
types: {
Expand Down Expand Up @@ -348,12 +349,17 @@ export const createDetourMachine = setup({
on: {
"detour.edit.place-waypoint-on-route": {
target: "Place Waypoint",
actions: {
type: "detour.add-start-point",
params: ({ event: { location } }) => ({
location,
}),
},
actions: [
{
type: "detour.add-start-point",
params: ({ event: { location } }) => ({
location,
}),
},
() => {
fullStoryEvent("Placed Detour Start Point", {})
},
],
},
},
},
Expand Down Expand Up @@ -394,21 +400,31 @@ export const createDetourMachine = setup({
"detour.edit.place-waypoint": {
target: "Place Waypoint",
reenter: true,
actions: {
type: "detour.add-waypoint",
params: ({ event: { location } }) => ({
location,
}),
},
actions: [
{
type: "detour.add-waypoint",
params: ({ event: { location } }) => ({
location,
}),
},
() => {
fullStoryEvent("Placed Detour Way-Point", {})
},
],
},
"detour.edit.place-waypoint-on-route": {
target: "Finished Drawing",
actions: {
type: "detour.add-end-point",
params: ({ event: { location } }) => ({
location,
}),
},
actions: [
{
type: "detour.add-end-point",
params: ({ event: { location } }) => ({
location,
}),
},
() => {
fullStoryEvent("Placed Detour End Point", {})
},
],
},
"detour.edit.undo": [
{
Expand Down

0 comments on commit b5dac4c

Please sign in to comment.