From 863d9296e1aa6e503f69dbe4b08072ba2f594670 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Fri, 20 Dec 2024 12:13:50 -0500 Subject: [PATCH] fix(TripPlanner): Clear the map when switching back to summary view (#2283) --- 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