mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
refactor: add callback to loadNotifications
This commit is contained in:
@@ -24,7 +24,8 @@ define('notifications', [
|
||||
});
|
||||
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) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -68,6 +69,7 @@ define('notifications', [
|
||||
notifications: notifs,
|
||||
list: notifList,
|
||||
});
|
||||
callback();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user