automatically update xd score when new xd is added

This commit is contained in:
2026-05-14 16:17:54 +02:00
parent 0f0da0c2ef
commit 9fb5e6c391
2 changed files with 7 additions and 0 deletions

View File

@@ -2612,6 +2612,12 @@ class CommentSystem {
this.syncSubscribeButton(true);
}
// Update xD score badge immediately from the POST response —
// faster and more reliable than waiting for the SSE NOTIFY.
if (typeof json.xd_score === 'number' && typeof window.updateXdBadgeFromScore === 'function') {
window.updateXdBadgeFromScore(this.itemId, json.xd_score);
}
this._silentSync();
this._finishSubmit(submitBtn, originalBtnHtml, parentId);
} else {