mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-11-21 23:50:59 +00:00
untrack user from presence when a new profile is chosen
This commit is contained in:
parent
6d39e774e6
commit
e76742a27b
1 changed files with 4 additions and 0 deletions
|
@ -155,6 +155,10 @@ defmodule LiveBeatsWeb.PlayerLive do
|
|||
|
||||
if profile && connected?(socket) do
|
||||
current_user = Accounts.update_active_profile(current_user, profile.user_id)
|
||||
#untrack last profile the user was listening
|
||||
if socket.assigns.profile do
|
||||
LiveBeats.PresenceClient.untrack(socket.assigns.profile, current_user.id)
|
||||
end
|
||||
LiveBeats.PresenceClient.track(profile, current_user.id)
|
||||
send(self(), :play_current)
|
||||
|
||||
|
|
Loading…
Reference in a new issue