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:
Barış Soner Uşaklı
2019-10-10 22:03:41 -04:00
parent 88818a5bbf
commit 3775301f24
3 changed files with 12 additions and 15 deletions

View File

@@ -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) {