From d9b5a617025b0001eeb69fe386c353e3e4497584 Mon Sep 17 00:00:00 2001 From: Chris McCord Date: Wed, 10 Nov 2021 15:07:46 -0500 Subject: [PATCH] Limit number of error messages --- lib/live_beats_web/live/song_live/upload_form_component.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/live_beats_web/live/song_live/upload_form_component.ex b/lib/live_beats_web/live/song_live/upload_form_component.ex index 6c1d1fd..102b1ba 100644 --- a/lib/live_beats_web/live/song_live/upload_form_component.ex +++ b/lib/live_beats_web/live/song_live/upload_form_component.ex @@ -195,7 +195,7 @@ defmodule LiveBeatsWeb.SongLive.UploadFormComponent do socket |> cancel_upload(:mp3, entry.ref) |> drop_changeset(entry.ref) - |> update(:error_messages, &(&1 ++ [{entry.client_name, reason}])) + |> update(:error_messages, &(Enum.take(&1 ++ [{entry.client_name, reason}], -10))) end defp get_entry!(socket, entry_ref) do