From f5536d387a79b78314dabaed263106a611e8c43f Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Thu, 19 Dec 2024 18:06:43 -0500 Subject: [PATCH] fix: Make the first "Depart at" button active when selecting an itinerary group --- lib/dotcom_web/live/trip_planner.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/dotcom_web/live/trip_planner.ex b/lib/dotcom_web/live/trip_planner.ex index a0c09a2dc8..43d49ab640 100644 --- a/lib/dotcom_web/live/trip_planner.ex +++ b/lib/dotcom_web/live/trip_planner.ex @@ -203,9 +203,11 @@ defmodule DotcomWeb.Live.TripPlanner do points: itinerary_groups_to_points(socket.assigns.results.itinerary_groups, index) } + new_results = %{itinerary_group_selection: index, itinerary_selection: 0} + new_socket = socket - |> assign(:results, Map.put(socket.assigns.results, :itinerary_group_selection, index)) + |> assign(:results, Map.merge(socket.assigns.results, new_results)) |> assign(:map, Map.merge(socket.assigns.map, new_map)) {:noreply, new_socket}