mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-26 16:41:21 +01:00
only rescind if nids exist
This commit is contained in:
@@ -373,7 +373,10 @@ Notifications.pushGroups = async function (notification, groupNames) {
|
||||
|
||||
Notifications.rescind = async function (nids) {
|
||||
nids = Array.isArray(nids) ? nids : [nids];
|
||||
|
||||
nids = Notifications.filterExists(nids);
|
||||
if (!nids.length) {
|
||||
return;
|
||||
}
|
||||
await plugins.hooks.fire('static:notifications.rescind', { nids });
|
||||
await Promise.all([
|
||||
db.sortedSetRemove('notifications', nids),
|
||||
|
||||
Reference in New Issue
Block a user