mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
favourite changes
favourites.js no longer makes socket calls, moved that code into socket.io/posts.js. it also makes a single socket call when you downvote a post that you previously upvoted.
This commit is contained in:
@@ -111,6 +111,10 @@ define(['composer', 'share'], function(composer, share) {
|
||||
socket.emit(method, {
|
||||
pid: pid,
|
||||
room_id: app.currentRoom
|
||||
}, function(err) {
|
||||
if (err) {
|
||||
app.alertError(err.message);
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
@@ -123,6 +127,10 @@ define(['composer', 'share'], function(composer, share) {
|
||||
socket.emit(currentState ? 'posts.unvote' : method , {
|
||||
pid: post.attr('data-pid'),
|
||||
room_id: app.currentRoom
|
||||
}, function(err) {
|
||||
if (err) {
|
||||
app.alertError(err.message);
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user