ソースを参照

Display only 2 available slots

theenglishway (time) 4 年 前
コミット
cbf8cee40b
1 ファイル変更3 行追加3 行削除
  1. 3 3
      lib/vaccins_web/live/location_component.ex

+ 3 - 3
lib/vaccins_web/live/location_component.ex

@@ -134,15 +134,15 @@ defmodule VaccinsWeb.LocationComponent do
        when is_list(after_slots),
        do:
          assigns
-         |> Map.put(:slots_after, after_slots |> Enum.take(5))
+         |> Map.put(:slots_after, after_slots |> Enum.take(2))
          |> Map.put(:slots_before, [])
 
   defp integrate_availabilities(assigns = %{availabilities: {:ok, before_slots, after_slots}})
        when is_list(before_slots),
        do:
          assigns
-         |> Map.put(:slots_after, after_slots |> Enum.take(5))
-         |> Map.put(:slots_before, before_slots |> Enum.take(5))
+         |> Map.put(:slots_after, after_slots |> Enum.take(2))
+         |> Map.put(:slots_before, before_slots |> Enum.take(2))
          |> Map.put(:last_early_slot_seen, DateTime.utc_now())
 
   defp integrate_availabilities(assigns), do: assigns