Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fix badges not showing up #6730

Merged
merged 2 commits into from
Oct 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions js/src/redux/providers/certifications/certifiers.monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 };
Expand Down Expand Up @@ -274,16 +274,17 @@ 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));
}

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 () {
Expand Down