From f7db31e89a2523eec2402fc7994f59f5a1b51171 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Fri, 20 Dec 2024 12:43:25 -0500 Subject: [PATCH] fix: Make the first "Depart at" button active when selecting an itinerary group (#2282) --- 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 24ca238d9c..c9fa1cd0ab 100644 --- a/lib/dotcom_web/live/trip_planner.ex +++ b/lib/dotcom_web/live/trip_planner.ex @@ -209,9 +209,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}