socket update
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 33s

This commit is contained in:
2026-01-30 18:08:26 -05:00
parent fabf1d9de9
commit 88f7b0678b
3 changed files with 17 additions and 0 deletions

View File

@@ -42,12 +42,19 @@ export default function Friends() {
}
};
const handleFriendRemoved = (data) => {
toast(`${data.removed_by_username} removed you from their friends`);
loadData(); // Refresh friends list
};
socket.on('friend:request', handleFriendRequest);
socket.on('friend:response', handleFriendResponse);
socket.on('friend:removed', handleFriendRemoved);
return () => {
socket.off('friend:request', handleFriendRequest);
socket.off('friend:response', handleFriendResponse);
socket.off('friend:removed', handleFriendRemoved);
};
}, [socket]);