Commit e8941162 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: wire opponent panel tap to profile popup in live mode

showOpponentPopup existed but was never called. Now tapping an
opponent's panel in live mode opens their profile with add-friend option.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent b5ca9475
...@@ -231,7 +231,7 @@ export function mountGame(el, params) { ...@@ -231,7 +231,7 @@ export function mountGame(el, params) {
audio.play('sfx_emote', 'ui'); audio.play('sfx_emote', 'ui');
}); });
// Fetch opponent profiles and update player panels (name + avatar) // Fetch opponent profiles and update player panels (name + avatar + tap for profile)
if (params.players) { if (params.players) {
params.players.forEach((pId, i) => { params.players.forEach((pId, i) => {
if (i === myPlayerIndex || pId.startsWith('bot')) return; if (i === myPlayerIndex || pId.startsWith('bot')) return;
...@@ -247,6 +247,8 @@ export function mountGame(el, params) { ...@@ -247,6 +247,8 @@ export function mountGame(el, params) {
if (avatarEl && profile.avatar_url) { if (avatarEl && profile.avatar_url) {
avatarEl.innerHTML = `<img src="${profile.avatar_url}" style="width:100%;height:100%;object-fit:cover;border-radius:50%;">`; avatarEl.innerHTML = `<img src="${profile.avatar_url}" style="width:100%;height:100%;object-fit:cover;border-radius:50%;">`;
} }
panel.style.cursor = 'pointer';
panel.addEventListener('click', () => showOpponentPopup(el, profile));
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment