mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 16:30:34 +01:00
display_moderator_tools is already returned
when new posts were loaded, we were making a socket call for each post to check if the post is editable, but this data is already returned in display_moderator_tools when posts are loaded.
This commit is contained in:
@@ -775,17 +775,8 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
|
||||
|
||||
|
||||
function onNewPostsLoaded(html, posts) {
|
||||
function getPostPrivileges(pid) {
|
||||
socket.emit('posts.getPrivileges', pid, function(err, privileges) {
|
||||
if(err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
toggle_mod_tools(privileges.pid, privileges.editable);
|
||||
});
|
||||
}
|
||||
|
||||
for (var x = 0, numPosts = posts.length; x < numPosts; x++) {
|
||||
getPostPrivileges(posts[x].pid);
|
||||
toggle_mod_tools(posts[x].pid, posts[x].display_moderator_tools);
|
||||
}
|
||||
|
||||
infiniteLoaderActive = false;
|
||||
|
||||
Reference in New Issue
Block a user