mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #7958, give rewards one by one
no need to check group.exists when leaving groups, if group doesn't exists isMember will be false anyways
This commit is contained in:
@@ -132,17 +132,16 @@ module.exports = function (Plugins) {
|
||||
if (!Array.isArray(hookList) || !hookList.length) {
|
||||
return;
|
||||
}
|
||||
await async.each(hookList, function (hookObj, next) {
|
||||
for (const hookObj of hookList) {
|
||||
if (typeof hookObj.method !== 'function') {
|
||||
if (global.env === 'development') {
|
||||
winston.warn('[plugins] Expected method for hook \'' + hook + '\' in plugin \'' + hookObj.id + '\' not found, skipping.');
|
||||
}
|
||||
return next();
|
||||
} else {
|
||||
/* eslint-disable no-await-in-loop */
|
||||
await hookObj.method(params);
|
||||
}
|
||||
|
||||
hookObj.method(params);
|
||||
next();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function fireStaticHook(hook, hookList, params) {
|
||||
|
||||
Reference in New Issue
Block a user