mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-05-09 23:04:48 +02:00
fix(dm): show 'Attempt 1/...' immediately after sending DM
The retry progress element was always created empty. The socket event with the real attempt count could arrive before the DOM was ready, causing it to be lost. Now pending messages pre-populate with 'Attempt 1/...' which gets updated to the real count when the socket event arrives. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+7
-2
@@ -1208,8 +1208,13 @@ function displayMessages(messages) {
|
||||
deliveryMeta = `<div class="dm-delivery-meta">${parts.join(', ')}</div>`;
|
||||
}
|
||||
|
||||
// Retry counter placeholder (same line as delivery meta)
|
||||
const retryInfo = msg.is_own ? `<div class="dm-delivery-meta dm-retry-info" data-dm-id="${msg.id || ''}"></div>` : '';
|
||||
// Retry counter placeholder — pre-populate for in-progress sends
|
||||
let retryInfo = '';
|
||||
if (msg.is_own) {
|
||||
const isPending = !msg.status || (msg.status !== 'delivered' && msg.status !== 'failed');
|
||||
const initialText = isPending && msg.expected_ack ? 'Attempt 1/...' : '';
|
||||
retryInfo = `<div class="dm-delivery-meta dm-retry-info" data-dm-id="${msg.id || ''}">${initialText}</div>`;
|
||||
}
|
||||
|
||||
// Resend button for own messages
|
||||
const resendBtn = msg.is_own ? `
|
||||
|
||||
Reference in New Issue
Block a user