mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-03-28 17:42:45 +01:00
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:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user