From eaf2ee8aca156827c39362555995b2fd1ec76883 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Sat, 8 Feb 2020 18:50:11 +0100 Subject: [PATCH] Update EditUsers.plugin.js --- Plugins/EditUsers/EditUsers.plugin.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index 1b3cf6c9bb..d1725bb9b9 100644 --- a/Plugins/EditUsers/EditUsers.plugin.js +++ b/Plugins/EditUsers/EditUsers.plugin.js @@ -4,7 +4,7 @@ var EditUsers = (_ => { return class EditUsers { getName () {return "EditUsers";} - getVersion () {return "3.7.2";} + getVersion () {return "3.7.3";} getAuthor () {return "DevilBro";} @@ -360,19 +360,21 @@ var EditUsers = (_ => { processUserPopout (e) { if (e.instance.props.user && BDFDB.DataUtils.get(this, "settings", "changeInUserPopout")) { + let data = BDFDB.DataUtils.load(this, "users", e.instance.props.user.id); if (!e.returnvalue) { e.instance.props.user = this.getUserData(e.instance.props.user.id, true, true); - let data = BDFDB.DataUtils.load(this, "users", e.instance.props.user.id); if (data && data.name) { e.instance.props.nickname = data.name; e.instance.props.guildMember = Object.assign({}, e.instance.props.guildMember, {nick: data.name}); } } else { - let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadernickname]]}); - if (index > -1) { - this.changeUserColor(children[index], e.instance.props.user.id, {changeBackground:true}); - this.injectBadge(children, e.instance.props.user.id, BDFDB.LibraryModules.LastGuildStore.getGuildId(), 2, BDFDB.disCN.bottagnametag, !!e.instance.props.activity); + if (data && (data.color1 || data.color2 || data.tag)) { + let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadernickname]]}); + if (index > -1) { + this.changeUserColor(children[index], e.instance.props.user.id, {changeBackground:true}); + this.injectBadge(children, e.instance.props.user.id, BDFDB.LibraryModules.LastGuildStore.getGuildId(), 2, BDFDB.disCN.bottagnametag, !!e.instance.props.activity); + } } } }