Is there a way to use flash with LiveDashboard?

Hi there!

I tried to use flash in live dashboard with zero success. So, I looked through the code in this is the only reference I find

 defp validate_nodes_or_redirect(socket) do
    if socket.assigns.page.node not in nodes() do
      socket
      |> put_flash(:error, "Node #{socket.assigns.page.node} disconnected.")
      |> redirect_to_current_node()
    else
      assign(socket, nodes: nodes())
    end
  end

However, I cannot recall seeing any flash message at all (I’m even doubting you can do that… what the chip do I know)

Is there a way to use flash with LiveDashboard?

nvm! I found a way. the flash map is passed on to update callback. so I just added my own html to render flash messages. thanks!

1 Like