mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
refactor: add callback to loadNotifications
This commit is contained in:
@@ -24,7 +24,8 @@ define('notifications', [
|
|||||||
});
|
});
|
||||||
hooks.on('filter:notifications.load', _addShortTimeagoString);
|
hooks.on('filter:notifications.load', _addShortTimeagoString);
|
||||||
|
|
||||||
Notifications.loadNotifications = function (notifList) {
|
Notifications.loadNotifications = function (notifList, callback) {
|
||||||
|
callback = callback || function () {};
|
||||||
socket.emit('notifications.get', null, function (err, data) {
|
socket.emit('notifications.get', null, function (err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return app.alertError(err.message);
|
return app.alertError(err.message);
|
||||||
@@ -68,6 +69,7 @@ define('notifications', [
|
|||||||
notifications: notifs,
|
notifications: notifs,
|
||||||
list: notifList,
|
list: notifList,
|
||||||
});
|
});
|
||||||
|
callback();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user