Update conversations.php

This commit is contained in:
Lizandro Guarnizo
2026-01-27 01:20:42 -05:00
parent ab4e9b6438
commit 63ba3c028e
+19 -1
View File
@@ -3678,7 +3678,25 @@
el.style.borderRadius = '20px';
el.style.boxShadow = '0 6px 18px rgba(2,6,23,0.12)';
el.style.cursor = 'pointer';
el.onclick = () => this.applyStagedMessages();
el.onclick = async () => {
try {
// Hide indicator immediately and suspend auto-refresh to avoid races
this.hideNewMessagesIndicator();
this._suspendAutoRefresh = true;
if (this.currentUserId) {
// Trigger a full load and follow to bottom
await this.loadMessages(this.currentUserId, true, true);
}
// Clear staged messages since full load will include them
this._stagedMessages = [];
if (this._stagedMessageIds) this._stagedMessageIds.clear();
this._stagedCount = 0;
} catch (e) {
console.warn('Indicator click failed to load full conversation', e);
} finally {
try { this._suspendAutoRefresh = false; } catch(e) {}
}
};
// subtle fade-in
el.style.opacity = '0';
el.style.transition = 'opacity 220ms ease, transform 220ms ease';