From 44dd4fa00c46c2330bc6a24ff1d9b81b2fe38019 Mon Sep 17 00:00:00 2001 From: Ricky Panzer Date: Thu, 30 Jan 2020 20:20:07 +0000 Subject: [PATCH] commento.js: re-render comments after login Re-render comments after login to accurately paint votes and allow upvoting without reprompting user to login, even though they're logged in. Closes https://gitlab.com/commento/commento/issues/170 --- frontend/js/commento.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/js/commento.js b/frontend/js/commento.js index 6de8ac0..903db83 100644 --- a/frontend/js/commento.js +++ b/frontend/js/commento.js @@ -1452,6 +1452,8 @@ function commentsRender() { var commentsArea = $(ID_COMMENTS_AREA); + commentsArea.innerHTML = "" + var cards = commentsRecurse(parentMap(comments), "root"); if (cards) { append(commentsArea, cards); @@ -1503,6 +1505,7 @@ } + // OAuth logic global.commentoAuth = function(data) { var provider = data.provider; var id = data.id; @@ -1536,9 +1539,11 @@ if (id !== null) { global.commentNew(id, resp.commenterToken, function() { global.loginBoxClose(); + commentsGet(commentsRender); }); } else { global.loginBoxClose(); + commentsGet(commentsRender); } }); } @@ -1767,9 +1772,11 @@ if (id !== null) { global.commentNew(id, resp.commenterToken, function() { global.loginBoxClose(); + commentsGet(commentsRender); }); } else { global.loginBoxClose(); + commentsGet(commentsRender); } }); }