automatically update xd score when new xd is added
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -445,6 +445,7 @@ export default (router, tpl) => {
|
||||
body: JSON.stringify({
|
||||
success: true,
|
||||
comment: newComment[0],
|
||||
xd_score: xdRow?.xd_score ?? null,
|
||||
is_new_subscription
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user