Skip to content

Node.js based forum software built for the modern web

notif fix

Baris Soner Usakliaa2978976c56
diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js
index 8994ba008a..2fff715165 100644
--- a/public/src/modules/notifications.js
+++ b/public/src/modules/notifications.js
@@ -21,7 +21,7 @@ define(function() {
if (!err && (data.read.length + data.unread.length) > 0) {
for (x = 0; x < numUnread; x++) {
notifEl.setAttribute('data-nid', data.unread[x].nid);
- notifEl.className = 'unread';
+ notifEl.className = data.unread[x].readClass;
notifEl.innerHTML = '<a href="' + data.unread[x].path + '"><span class="pull-right">' + utils.relativeTime(data.unread[x].datetime, true) + '</span>' + data.unread[x].text + '</a>';
notifFrag.appendChild(notifEl.cloneNode(true));
}
diff --git a/src/user.js b/src/user.js
index 2ec7bf70cb..a08b6eb982 100644
--- a/src/user.js
+++ b/src/user.js
@@ -933,6 +933,7 @@ var bcrypt = require('bcrypt'),
notifications.get(nid, uid, function(notif_data) {
// If the notification could not be found, silently drop it
if (notif_data) {
+ notif_data.readClass = !notif_data.read ? 'label-warning' : '';
unread.push(notif_data);
} else {
db.sortedSetRemove('uid:' + uid + ':notifications:unread', nid);