Use LiveToast instead of built-in flash helpers

So that they can stack and get dismissed automatically
This commit is contained in:
Claudio Ortolina
2025-07-16 15:26:30 +01:00
parent 41f040363e
commit acd34424f7
18 changed files with 64 additions and 61 deletions
@@ -323,7 +323,7 @@ defmodule MusicLibraryWeb.BarcodeScannerComponent do
"Failed to search release for barcode #{number}: #{inspect(reason)}"
end)
put_flash(
put_toast(
socket,
:error,
gettext("Failed to search release for barcode %{number}", number: number)
@@ -339,7 +339,7 @@ defmodule MusicLibraryWeb.BarcodeScannerComponent do
socket =
case BarcodeScan.import_results(socket.assigns.scan_results, current_time) do
[] ->
put_flash(socket, :info, gettext("Records imported successfully"))
put_toast(socket, :info, gettext("Records imported successfully"))
errors ->
errors_summary =
@@ -347,7 +347,7 @@ defmodule MusicLibraryWeb.BarcodeScannerComponent do
"#{number}: #{inspect(reason)}"
end)
put_flash(
put_toast(
socket,
:error,
gettext("Some records could not be imported: %{summary}", summary: errors_summary)