Просмотр исходного кода

Do nothing in query_sent and query_result handlers

theenglishway (time) 4 лет назад
Родитель
Сommit
dda5c8e95f
1 измененных файлов с 2 добавлено и 4 удалено
  1. 2 4
      lib/vaccins_web/live/index.ex

+ 2 - 4
lib/vaccins_web/live/index.ex

@@ -67,7 +67,7 @@ defmodule VaccinsWeb.IndexLive do
 
   @impl true
   def handle_info({:query_sent, id, ref}, socket = %{assigns: %{pending: pending}}) do
-    {:noreply, socket |> assign(pending: pending |> Map.put(ref, id))}
+    {:noreply, socket}
   end
 
   def handle_info(:periodic_refresh, socket = %{assigns: %{display_cs: false}}),
@@ -105,9 +105,7 @@ defmodule VaccinsWeb.IndexLive do
         {:query_result, ref, res},
         socket = %{assigns: %{locations: valid, pending: pending}}
       ) do
-    id = pending |> Map.get(ref)
-    send_update(VaccinsWeb.LocationComponent, id: id, availabilities: res)
-    {:noreply, socket |> assign(pending: pending |> Map.delete(ref))}
+    {:noreply, socket}
   end
 
   def handle_info({:location_availabilities, id, res}, socket = %{assigns: %{locations: valid}}) do