Files
music_library/lib/music_library_web/hooks/static_assets.ex
T
Claudio Ortolina acd34424f7 Use LiveToast instead of built-in flash helpers
So that they can stack and get dismissed automatically
2025-07-16 15:26:30 +01:00

15 lines
356 B
Elixir

defmodule MusicLibraryWeb.Hooks.StaticAssets do
use MusicLibraryWeb, :live_component
def on_mount(:default, _params, _session, socket) do
socket =
if static_changed?(socket) do
put_toast(socket, :warning, gettext("The application has been updated, please reload."))
else
socket
end
{:cont, socket}
end
end