mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
remove parseInts
This commit is contained in:
@@ -60,9 +60,8 @@ module.exports = function (SocketPosts) {
|
||||
function (results, next) {
|
||||
var posts = results.posts;
|
||||
posts.tools = results.tools.tools;
|
||||
posts.deleted = parseInt(posts.deleted, 10) === 1;
|
||||
posts.bookmarked = results.bookmarked;
|
||||
posts.selfPost = socket.uid && socket.uid === parseInt(posts.uid, 10);
|
||||
posts.selfPost = socket.uid && socket.uid === posts.uid;
|
||||
posts.display_edit_tools = results.canEdit.flag;
|
||||
posts.display_delete_tools = results.canDelete.flag;
|
||||
posts.display_purge_tools = results.canPurge;
|
||||
@@ -226,9 +225,9 @@ module.exports = function (SocketPosts) {
|
||||
posts.getTopicFields(pid, ['tid', 'cid', 'deleted'], next);
|
||||
},
|
||||
function (topic, next) {
|
||||
if (parseInt(topic.deleted, 10) !== 1 && command === 'delete') {
|
||||
if (command === 'delete' && !topic.deleted) {
|
||||
socketTopics.doTopicAction('delete', 'event:topic_deleted', socket, { tids: [topic.tid], cid: topic.cid }, next);
|
||||
} else if (parseInt(topic.deleted, 10) === 1 && command === 'restore') {
|
||||
} else if (command === 'restore' && topic.deleted) {
|
||||
socketTopics.doTopicAction('restore', 'event:topic_restored', socket, { tids: [topic.tid], cid: topic.cid }, next);
|
||||
} else {
|
||||
setImmediate(next);
|
||||
@@ -244,7 +243,7 @@ module.exports = function (SocketPosts) {
|
||||
},
|
||||
isLast: function (next) {
|
||||
posts.getTopicFields(pid, ['postcount'], function (err, topic) {
|
||||
next(err, topic ? parseInt(topic.postcount, 10) === 1 : false);
|
||||
next(err, topic ? topic.postcount === 1 : false);
|
||||
});
|
||||
},
|
||||
}, callback);
|
||||
|
||||
Reference in New Issue
Block a user