Fixed compact mode issue in EditUsers

This commit is contained in:
Mirco Wittrien 2018-12-30 09:35:31 +01:00
parent 352e3df0b4
commit 7411301749
1 changed files with 6 additions and 4 deletions

View File

@ -147,7 +147,7 @@ class EditUsers {
getDescription () {return "Allows you to change the icon, name, tag and color of users. Does not work in compact mode.";} getDescription () {return "Allows you to change the icon, name, tag and color of users. Does not work in compact mode.";}
getVersion () {return "3.1.0";} getVersion () {return "3.1.1";}
getAuthor () {return "DevilBro";} getAuthor () {return "DevilBro";}
@ -253,7 +253,7 @@ class EditUsers {
var userContextSubMenu = $(this.userContextSubMenuMarkup); var userContextSubMenu = $(this.userContextSubMenuMarkup);
userContextSubMenu userContextSubMenu
.on("click", ".usersettings-item", () => { .on("click", ".usersettings-item", () => {
$(menu).hide(); instance._reactInternalFiber.return.memoizedProps.closeContextMenu();
this.showUserSettings(instance.props.user); this.showUserSettings(instance.props.user);
}); });
if (BDFDB.loadData(instance.props.user.id, this, "users")) { if (BDFDB.loadData(instance.props.user.id, this, "users")) {
@ -261,7 +261,7 @@ class EditUsers {
.find(".resetsettings-item") .find(".resetsettings-item")
.removeClass(BDFDB.disCN.contextmenuitemdisabled) .removeClass(BDFDB.disCN.contextmenuitemdisabled)
.on("click", () => { .on("click", () => {
$(menu).hide(); instance._reactInternalFiber.return.memoizedProps.closeContextMenu();
BDFDB.removeData(instance.props.user.id, this, "users"); BDFDB.removeData(instance.props.user.id, this, "users");
BDFDB.WebModules.forceAllUpdates(this); BDFDB.WebModules.forceAllUpdates(this);
}); });
@ -428,7 +428,9 @@ class EditUsers {
let username = wrapper.querySelector(BDFDB.dotCN.messageusername); let username = wrapper.querySelector(BDFDB.dotCN.messageusername);
if (username) { if (username) {
this.changeName(fiber.return.memoizedProps.message.author, username); this.changeName(fiber.return.memoizedProps.message.author, username);
this.changeAvatar(fiber.return.memoizedProps.message.author, this.getAvatarDiv(wrapper)); if (wrapper.parentElement && wrapper.parentElement.classList && !wrapper.parentElement.classList.contains(BDFDB.disCN.messageheadercompact)) {
this.changeAvatar(fiber.return.memoizedProps.message.author, this.getAvatarDiv(wrapper));
}
this.addTag(fiber.return.memoizedProps.message.author, wrapper); this.addTag(fiber.return.memoizedProps.message.author, wrapper);
} }
} }