Update StaffTag.plugin.js
This commit is contained in:
parent
8bf188760b
commit
e9cc0859e5
|
@ -97,7 +97,6 @@ module.exports = (_ => {
|
|||
"MemberListItem",
|
||||
"NameTag",
|
||||
"UsernameSection",
|
||||
"UserPopoutInfo",
|
||||
"VoiceUser"
|
||||
]
|
||||
};
|
||||
|
@ -334,22 +333,6 @@ module.exports = (_ => {
|
|||
}
|
||||
}
|
||||
|
||||
processUserPopoutInfo (e) {
|
||||
if (e.instance.props.user && this.settings.tagPlaces.userPopout) {
|
||||
let userType = this.getUserType(e.instance.props.user, e.instance.props.channel && e.instance.props.channel.id);
|
||||
if (userType) {
|
||||
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadernickname]]});
|
||||
if (index > -1) {
|
||||
if (!BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children = [children[index].props.children].flat(10);
|
||||
this.injectStaffTag(children[index].props.children, e.instance.props.user, userType, 2, {
|
||||
tagClass: BDFDB.disCNS.userpopoutheaderbottag + BDFDB.disCN.bottagnametag,
|
||||
inverted: typeof e.instance.getMode == "function" && e.instance.getMode() !== "Normal"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
injectStaffTag (children, user, userType, insertIndex, config = {}) {
|
||||
if (!BDFDB.ArrayUtils.is(children) || !user) return;
|
||||
let [_, index] = BDFDB.ReactUtils.findParent(children, {props: [["text", [BDFDB.LanguageUtils.LanguageStrings.GROUP_OWNER, BDFDB.LanguageUtils.LanguageStrings.GUILD_OWNER]]]});
|
||||
|
|
Loading…
Reference in New Issue