From 5dca54638d9c9a6152d040516a34299b12fc5d81 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Thu, 19 Dec 2024 18:13:58 -0500 Subject: [PATCH] fix(TripPlanner): Clear the map when switching back to summary view --- lib/dotcom_web/live/trip_planner.ex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/dotcom_web/live/trip_planner.ex b/lib/dotcom_web/live/trip_planner.ex index a0c09a2dc8..24ca238d9c 100644 --- a/lib/dotcom_web/live/trip_planner.ex +++ b/lib/dotcom_web/live/trip_planner.ex @@ -169,9 +169,15 @@ defmodule DotcomWeb.Live.TripPlanner do itinerary_selection: nil } + new_map = %{ + lines: [], + points: [] + } + new_socket = socket |> assign(:results, Map.merge(socket.assigns.results, new_results)) + |> assign(:map, Map.merge(socket.assigns.map, new_map)) {:noreply, new_socket} end