Commit 44dd4fa0 authored by Ricky Panzer's avatar Ricky Panzer Committed by Adhityaa Chandrasekar

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 #170
parent 2006b02f
......@@ -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);
}
});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment