# myapp_web.ex
def live_view do
quote do
use Phoenix.LiveView,
layout: {NubacoinsWeb.Layouts, :app}
unquote(html_helpers())
unquote(flash_helpers()) # <- Added this line
end
end
def flash_helpers do
quote do
def handle_info(:clear_flash, socket) do
{:noreply, clear_flash(socket)}
end
end
end
# app.html.heex
<.flash_group phx-mount={Process.send_after(self(), :clear_flash, 3000)} flash={@flash} />