mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-11-22 08:01:00 +00:00
Fix username not updating on presence when settings changed
This commit is contained in:
parent
83db1294f9
commit
5ce9142253
1 changed files with 7 additions and 0 deletions
|
@ -249,6 +249,13 @@ defmodule LiveBeatsWeb.PlayerLive do
|
||||||
end
|
end
|
||||||
|
|
||||||
def handle_info({MediaLibrary, %MediaLibrary.Events.PublicProfileUpdated{} = update}, socket) do
|
def handle_info({MediaLibrary, %MediaLibrary.Events.PublicProfileUpdated{} = update}, socket) do
|
||||||
|
%{current_user: current_user} = socket.assigns
|
||||||
|
|
||||||
|
if update.profile.user_id == socket.assigns.current_user.id do
|
||||||
|
LiveBeats.PresenceClient.untrack(socket.assigns.profile, current_user.id)
|
||||||
|
LiveBeats.PresenceClient.track(update.profile, current_user.id)
|
||||||
|
end
|
||||||
|
|
||||||
{:noreply, assign_profile(socket, update.profile)}
|
{:noreply, assign_profile(socket, update.profile)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue