From dc4fd4160a15b41c6fcb95d88b604795f5266e5b Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sun, 16 Feb 2025 13:42:19 +0000 Subject: [PATCH] Use a list for scanned releases Doesn't remove duplicates, but guarantees a predictable order where the most recently scanned element is at the top --- .../live/record_live/barcode_scanner_component.ex | 13 ++++++------- priv/gettext/default.pot | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/music_library_web/live/record_live/barcode_scanner_component.ex b/lib/music_library_web/live/record_live/barcode_scanner_component.ex index b05c1896..bb6d4dbd 100644 --- a/lib/music_library_web/live/record_live/barcode_scanner_component.ex +++ b/lib/music_library_web/live/record_live/barcode_scanner_component.ex @@ -11,7 +11,7 @@ defmodule MusicLibraryWeb.RecordLive.BarcodeScannerComponent do {:ok, socket |> assign(:camera, :pending) - |> assign(:releases, %{})} + |> assign(:releases, [])} end @impl true @@ -53,7 +53,7 @@ defmodule MusicLibraryWeb.RecordLive.BarcodeScannerComponent do