Update EditUsers.plugin.js

This commit is contained in:
Mirco Wittrien 2022-09-24 17:31:12 +02:00
parent 97b5046e77
commit a6559f5296
1 changed files with 19 additions and 12 deletions

View File

@ -2,7 +2,7 @@
* @name EditUsers * @name EditUsers
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 4.6.8 * @version 4.6.9
* @description Allows you to locally edit Users * @description Allows you to locally edit Users
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -100,6 +100,7 @@ module.exports = (_ => {
AutocompleteUserResult: "render", AutocompleteUserResult: "render",
UserThemeBanner: "default", UserThemeBanner: "default",
UserBanner: "default", UserBanner: "default",
UserBannerMask: "default",
UserPopoutAvatar: "UserPopoutAvatar", UserPopoutAvatar: "UserPopoutAvatar",
UserThemePopoutHeader: "default", UserThemePopoutHeader: "default",
UsernameSection: "default", UsernameSection: "default",
@ -604,25 +605,31 @@ module.exports = (_ => {
} }
processUserThemeBanner (e) { processUserThemeBanner (e) {
if (e.instance.props.user && changedUsers[e.instance.props.user.id]) { this.processUserBanner(e);
if (changedUsers[e.instance.props.user.id].removeBanner) e.instance.props.bannerSrc = null;
else if (changedUsers[e.instance.props.user.id].banner) e.instance.props.bannerSrc = changedUsers[e.instance.props.user.id].banner;
}
} }
processUserBanner (e) { processUserBanner (e) {
if (e.instance.props.user && changedUsers[e.instance.props.user.id]) { if (e.instance.props.user && changedUsers[e.instance.props.user.id]) {
if (changedUsers[e.instance.props.user.id].removeBanner) e.instance.props.bannerSrc = null; if (changedUsers[e.instance.props.user.id].removeBanner) {
else if (changedUsers[e.instance.props.user.id].banner) e.instance.props.bannerSrc = changedUsers[e.instance.props.user.id].banner; e.instance.props.bannerSrc = null;
e.instance.props.displayProfile.banner = null;
}
else if (changedUsers[e.instance.props.user.id].banner) {
e.instance.props.bannerSrc = changedUsers[e.instance.props.user.id].banner;
e.instance.props.displayProfile.banner = changedUsers[e.instance.props.user.id].banner;
}
}
}
processUserBannerMask (e) {
if (e.instance.props.user && changedUsers[e.instance.props.user.id]) {
if (changedUsers[e.instance.props.user.id].removeBanner) e.instance.props.isPremium = false;
else if (changedUsers[e.instance.props.user.id].banner) e.instance.props.isPremium = true;
} }
} }
processUserPopoutAvatar (e) { processUserPopoutAvatar (e) {
if (this.settings.places.userPopout && e.instance.props.user && changedUsers[e.instance.props.user.id]) e.instance.props.user = this.getUserData(e.instance.props.user.id, true, true); this.processUserThemePopoutHeader(e);
if (e.instance.props.displayProfile && e.instance.props.user && changedUsers[e.instance.props.user.id]) {
if (changedUsers[e.instance.props.user.id].removeBanner) e.instance.props.displayProfile.banner = null;
else if (changedUsers[e.instance.props.user.id].banner) e.instance.props.displayProfile.banner = changedUsers[e.instance.props.user.id].banner;
}
} }
processUserThemePopoutHeader (e) { processUserThemePopoutHeader (e) {