diff --git a/conversations.php b/conversations.php index 4b52f0a..66ef728 100644 --- a/conversations.php +++ b/conversations.php @@ -2113,6 +2113,15 @@ messages = data; } + // Guard: cuando paginamos (initial=false) y la respuesta no trae mensajes, + // no reemplazar ni limpiar la conversación actual; solo indicar que no hay más. + if (!initial && Array.isArray(messages) && messages.length === 0) { + try { if (topLoader && topLoader.parentNode) topLoader.remove(); } catch(e) {} + this.hasMoreMessages = false; + // preserve current view and stop further processing + return; + } + if (initial) { this.conversations = messages; } else {