From 279cc0125dd70d502e2548c9c6633335c4ea768f Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Sat, 22 Nov 2025 13:59:21 +0000 Subject: [PATCH] Fix avatar URL resolution in contact list: ensure full URL is used for non-relative avatar paths --- .../js/minigames/phone-chat/phone-chat-ui.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/public/break_escape/js/minigames/phone-chat/phone-chat-ui.js b/public/break_escape/js/minigames/phone-chat/phone-chat-ui.js index 805347b..565a3e5 100644 --- a/public/break_escape/js/minigames/phone-chat/phone-chat-ui.js +++ b/public/break_escape/js/minigames/phone-chat/phone-chat-ui.js @@ -365,9 +365,19 @@ export default class PhoneChatUI { lastMessageTime = this.formatTimestamp(lastMessage.timestamp); } + // Resolve avatar path to full URL if relative + let avatarSrc = npc.avatar; + if (npc.avatar && !npc.avatar.startsWith('/') && !npc.avatar.startsWith('http')) { + if (npc.avatar.startsWith('assets/')) { + avatarSrc = `/break_escape/${npc.avatar}`; + } else { + avatarSrc = `${ASSETS_PATH}/${npc.avatar}`; + } + } + contactItem.innerHTML = `
- ${npc.avatar ? `${npc.displayName}` : '👤'} + ${npc.avatar ? `${npc.displayName}` : '👤'}
${npc.displayName || npc.id}