mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-13 17:35:46 +01:00
closes #4101
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
"markAsUnreadForAll.success" : "Topic marked as unread for all.",
|
"markAsUnreadForAll.success" : "Topic marked as unread for all.",
|
||||||
"mark_unread": "Mark unread",
|
"mark_unread": "Mark unread",
|
||||||
|
"mark_unread.success": "Topic marked as unread.",
|
||||||
|
|
||||||
"watch": "Watch",
|
"watch": "Watch",
|
||||||
"unwatch": "Unwatch",
|
"unwatch": "Unwatch",
|
||||||
|
|||||||
@@ -54,7 +54,12 @@ define('forum/topic/threadTools', [
|
|||||||
});
|
});
|
||||||
|
|
||||||
topicContainer.on('click', '[component="topic/mark-unread"]', function() {
|
topicContainer.on('click', '[component="topic/mark-unread"]', function() {
|
||||||
socket.emit('topics.markUnread', tid);
|
socket.emit('topics.markUnread', tid, function(err) {
|
||||||
|
if (err) {
|
||||||
|
return app.alertError(err);
|
||||||
|
}
|
||||||
|
app.alertSuccess('[[topic:mark_unread.success]]');
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ module.exports = function(SocketTopics) {
|
|||||||
|
|
||||||
SocketTopics.markUnread = function(socket, tid, callback) {
|
SocketTopics.markUnread = function(socket, tid, callback) {
|
||||||
if (!tid || !socket.uid) {
|
if (!tid || !socket.uid) {
|
||||||
return callback();
|
return callback(new Error('[[error:invalid-data]]'));
|
||||||
}
|
}
|
||||||
topics.markUnread(tid, socket.uid, function(err) {
|
topics.markUnread(tid, socket.uid, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -64,6 +64,7 @@ module.exports = function(SocketTopics) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
topics.pushUnreadCount(socket.uid);
|
topics.pushUnreadCount(socket.uid);
|
||||||
|
callback();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user