diff --git a/js/src/redux/providers/certifications/certifiers.monitor.js b/js/src/redux/providers/certifications/certifiers.monitor.js index 208b728b3..d8ea5e451 100644 --- a/js/src/redux/providers/certifications/certifiers.monitor.js +++ b/js/src/redux/providers/certifications/certifiers.monitor.js @@ -206,7 +206,7 @@ export default class CertifiersMonitor { // Fetch the address, name and owner in one batch return querier(this.api, { address: instance.address, from, limit }, instance.badge) .then((results) => { - this.certifiers = results + const certifiers = results .map(([ address, name, owner ], index) => ({ address, owner, id: index + from, @@ -225,7 +225,7 @@ export default class CertifiersMonitor { }, {}); // Fetch the meta-data in serie - return Object.values(this.certifiers).reduce((promise, certifier) => { + return Object.values(certifiers).reduce((promise, certifier) => { return promise.then(() => badgeReg.fetchMeta(certifier.id)) .then((meta) => { this.certifiers[certifier.id] = { ...certifier, ...meta }; @@ -274,8 +274,6 @@ export default class CertifiersMonitor { .then((certified) => { const { id, title, icon, name } = certifier; - this.fetchedAccounts[address] = true; - if (!certified) { return this.store.dispatch(removeCertification(address, id)); } @@ -283,7 +281,10 @@ export default class CertifiersMonitor { log.debug('seen as certified', { address, id, name, icon }); this.store.dispatch(addCertification(address, id, name, title, icon)); }); - }, Promise.resolve()); + }, Promise.resolve()) + .then(() => { + this.fetchedAccounts[address] = true; + }); } setCertifiersFilter () {