From 3b5794a4012de85346e564a0fa7087bcf1a5cb09 Mon Sep 17 00:00:00 2001
From: Adam Piontek <adam@73k.us>
Date: Thu, 25 Mar 2021 18:09:53 -0400
Subject: [PATCH] tidying stray dev code

---
 .../live/shift_import_live/index.ex           | 31 +++++++++----------
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/lib/shift73k_web/live/shift_import_live/index.ex b/lib/shift73k_web/live/shift_import_live/index.ex
index 65a0e746..50f0264d 100644
--- a/lib/shift73k_web/live/shift_import_live/index.ex
+++ b/lib/shift73k_web/live/shift_import_live/index.ex
@@ -13,22 +13,21 @@ defmodule Shift73kWeb.ShiftImportLive.Index do
 
     socket
     |> assign_defaults(session)
-    |> assign(:url_valid, :false)
-    |> assign(:url_validated, :false)
-    |> assign(:tz_valid, :true)
+    |> assign(:url_valid, false)
+    |> assign(:url_validated, false)
+    |> assign(:tz_valid, true)
     |> live_okreply()
   end
 
   @impl true
   def handle_event("validate", %{"ics_import" => %{"ics_url" => url, "time_zone" => tz}}, socket) do
     socket
-    |> assign(:url_valid, Regex.match?(@url_regex, url) |> IO.inspect(label: "url valid?"))
+    |> assign(:url_valid, Regex.match?(@url_regex, url))
     |> assign(:url_validated, true)
     |> assign(:tz_valid, Enum.member?(Tzdata.zone_list(), tz))
     |> live_noreply()
   end
 
-
   @impl true
   def handle_event("save", %{"ics_import" => %{"ics_url" => url, "time_zone" => tz}}, socket) do
     url
@@ -57,16 +56,12 @@ defmodule Shift73kWeb.ShiftImportLive.Index do
   defp handle_parsed_ics_data([], socket, tz), do: handle_http_ics_response(false, socket, tz)
 
   defp handle_parsed_ics_data(events, socket, tz) do
-    IO.inspect(events, label: "We got some ical events! :")
-    IO.inspect(tz, label: "time zone was :")
-
-    to_insert =
-      events
-      |> Stream.map(&shift_from_event(&1, tz, socket.assigns.current_user.id))
-      |> Enum.map(&Repo.timestamp/1)
-      |> Shifts.create_multiple()
-      |> handle_create_multiple_result(length(events), socket)
-      |> live_noreply()
+    events
+    |> Stream.map(&shift_from_event(&1, tz, socket.assigns.current_user.id))
+    |> Enum.map(&Repo.timestamp/1)
+    |> Shifts.create_multiple()
+    |> handle_create_multiple_result(length(events), socket)
+    |> live_noreply()
   end
 
   defp handle_create_multiple_result(result, event_count, socket) do
@@ -81,14 +76,16 @@ defmodule Shift73kWeb.ShiftImportLive.Index do
           if n == event_count do
             {:success, "Successfully imported #{n} event#{s}"}
           else
-            {:warning, "Some error, only #{n} event#{s} imported but seemed like iCal contained #{event_count}?"}
+            {:warning,
+             "Some error, only #{n} event#{s} imported but seemed like iCal contained #{
+               event_count
+             }?"}
           end
       end
 
     put_flash(socket, status, msg)
   end
 
-
   defp content_type_calendar?(headers) do
     headers
     |> List.keyfind("Content-Type", 0)