Use live_action instead of params

This commit is contained in:
Chris McCord 2021-11-22 10:31:30 -05:00
parent 632b211c44
commit a7c319c035

View file

@ -4,10 +4,10 @@ defmodule LiveBeatsWeb.Nav do
alias LiveBeats.MediaLibrary
alias LiveBeatsWeb.{ProfileLive, SettingsLive}
def on_mount(:default, params, _session, socket) do
def on_mount(:default, _params, _session, socket) do
active_tab =
case {socket.view, params} do
{ProfileLive, %{"profile_username" => _profile}} -> :profile
case {socket.view, socket.assigns.live_action} do
{ProfileLive, _} -> :profile
{SettingsLive, _} -> :settings
{_, _} -> nil
end