refactor: add callback to loadNotifications

This commit is contained in:
Barış Soner Uşaklı
2021-10-23 14:56:17 -04:00
parent 7ef5214ef9
commit f02fba29dc

View File

@@ -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();
});
});
});