Update chat_window.php

This commit is contained in:
Lizandro Guarnizo
2026-01-22 10:58:12 -05:00
parent d9f52c8ca7
commit dcc87667be
+5 -2
View File
@@ -635,10 +635,13 @@ if (empty($user_id)) {
if (isMultimedia) {
console.log('→ Renderizando como multimedia:', msg.message_type);
// Mensaje multimedia
// Declarar variables de media aquí para evitar TDZ (referencias en otros `case`)
let thumbUrl = '';
let fullUrl = '';
switch (msg.message_type) {
case 'image':
// Determinar miniatura y URL completa (prioriza media_url_external o archivos locales)
let thumbUrl = '';
thumbUrl = '';
if (isValidMediaUrl(msg.local_thumb)) {
thumbUrl = `/${msg.local_thumb}`;
} else if (isValidMediaUrl(msg.local_file)) {
@@ -661,7 +664,7 @@ if (empty($user_id)) {
thumbUrl = msg.media_url;
}
let fullUrl = '';
fullUrl = '';
if (isValidMediaUrl(msg.local_file)) {
fullUrl = `/api/version/media-url.php?local=${encodeURIComponent(msg.local_file)}`;
} else if (isValidMediaUrl(msg.media_url_external)) {