From d42e8f66ca180e5ea3f10bf109cb845733c1fc63 Mon Sep 17 00:00:00 2001 From: Samuel Elliott Date: Fri, 27 Apr 2018 17:39:00 +0100 Subject: [PATCH] Fix badges not being rendered on update --- client/src/ui/profilebadges.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/client/src/ui/profilebadges.js b/client/src/ui/profilebadges.js index bd6c59d8..242f34cb 100644 --- a/client/src/ui/profilebadges.js +++ b/client/src/ui/profilebadges.js @@ -187,8 +187,8 @@ export default class extends Module { const c = contributors.find(c => c.id === user.id); if (!c) return; - const element = ReactHelpers.React.createElement('span', { - className: 'bd-profile-badges', + const element = ReactHelpers.React.createElement('div', { + className: 'bd-profile-badges-outer', 'data-userid': user.id }); @@ -216,7 +216,7 @@ export default class extends Module { } injectProfileBadges(element) { - for (const beo of element.getElementsByClassName('bd-profile-badges')) + for (const beo of element.getElementsByClassName('bd-profile-badges-outer')) this.injectProfileBadge(beo); } @@ -225,8 +225,6 @@ export default class extends Module { root.removeChild(root.firstChild); } - if (root.classList.contains('bd-has-badge')) return; - const { userid } = root.dataset; if (!userid) return; @@ -236,8 +234,8 @@ export default class extends Module { VueInjector.inject(root, { components: { BdBadge }, data: { c }, - template: '', - }); + template: '', + }, DOM.createElement('span')); } }