fix: Add delayed reloads to update echo counts after sending

Echo counts weren't appearing until sending another message because
auto-refresh only triggers when new messages arrive. Added 6s and 15s
delayed reloads after sending to catch echoes as they arrive.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-01-29 21:16:08 +01:00
parent 07040dd6d0
commit a2515c5372

View File

@@ -807,8 +807,11 @@ async function sendMessage() {
updateCharCounter();
showNotification('Message sent', 'success');
// Reload messages after short delay
// Reload messages after short delay to show sent message
setTimeout(() => loadMessages(), 1000);
// Reload again to catch echo counts (echoes typically arrive within 5-30 seconds)
setTimeout(() => loadMessages(), 6000);
setTimeout(() => loadMessages(), 15000);
} else {
showNotification('Failed to send: ' + data.error, 'danger');
}