From 63ba3c028e6ba9c57b39a86578d151d7d7641d14 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 27 Jan 2026 01:20:42 -0500 Subject: [PATCH] Update conversations.php --- conversations.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/conversations.php b/conversations.php index d111470..59ac3fb 100644 --- a/conversations.php +++ b/conversations.php @@ -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';