From a7c319c03529cfbc7c83c753d7451d9339690c05 Mon Sep 17 00:00:00 2001 From: Chris McCord Date: Mon, 22 Nov 2021 10:31:30 -0500 Subject: [PATCH] Use live_action instead of params --- lib/live_beats_web/live/nav.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/live_beats_web/live/nav.ex b/lib/live_beats_web/live/nav.ex index 57bd0a5..02a5426 100644 --- a/lib/live_beats_web/live/nav.ex +++ b/lib/live_beats_web/live/nav.ex @@ -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