This commit is contained in:
Mirco Wittrien 2022-09-03 16:19:40 +02:00
parent c0c5fec453
commit 0a1a73a379
3 changed files with 12 additions and 15 deletions

View File

@ -3193,16 +3193,12 @@ module.exports = (_ => {
return user && user instanceof Internal.DiscordObjects.User; return user && user instanceof Internal.DiscordObjects.User;
}; };
const myDataUser = Internal.LibraryModules.UserStore && Internal.LibraryModules.UserStore.getCurrentUser && Internal.LibraryModules.UserStore.getCurrentUser(); const myDataUser = Internal.LibraryModules.UserStore && Internal.LibraryModules.UserStore.getCurrentUser && Internal.LibraryModules.UserStore.getCurrentUser();
if (myDataUser && BDFDB.UserUtils._id != myDataUser.id) { if (myDataUser && BDFDB.UserUtils._id != myDataUser.id) BDFDB.UserUtils._id = myDataUser.id;
document.body.setAttribute("data-current-user-id", myDataUser.id);
BDFDB.UserUtils._id = myDataUser.id;
}
BDFDB.UserUtils.me = new Proxy(myDataUser || {}, { BDFDB.UserUtils.me = new Proxy(myDataUser || {}, {
get: function (list, item) { get: function (list, item) {
const user = Internal.LibraryModules.UserStore && Internal.LibraryModules.UserStore.getCurrentUser && Internal.LibraryModules.UserStore.getCurrentUser(); const user = Internal.LibraryModules.UserStore && Internal.LibraryModules.UserStore.getCurrentUser && Internal.LibraryModules.UserStore.getCurrentUser();
if (user && BDFDB.UserUtils._id != user.id) { if (user && BDFDB.UserUtils._id != user.id) {
Cache.data = {}; Cache.data = {};
document.body.setAttribute("data-current-user-id", user.id);
BDFDB.UserUtils._id = user.id; BDFDB.UserUtils._id = user.id;
} }
return user ? user[item] : null; return user ? user[item] : null;

View File

@ -314,14 +314,14 @@
"TypingUsers": {"class": "typing"}, "TypingUsers": {"class": "typing"},
"UnavailableGuildsButton": {"strings": ["className", ".default.guildsError"]}, "UnavailableGuildsButton": {"strings": ["className", ".default.guildsError"]},
"Upload": {"class": "uploadmodal"}, "Upload": {"class": "uploadmodal"},
"UserHook": {"class": "auditloguserhook"},
"UserMention": {"strings": ["inlinePreview", "getAvatarURL", "userId", "default.getName"]}, "UserMention": {"strings": ["inlinePreview", "getAvatarURL", "userId", "default.getName"]},
"UserPopoutAvatar": {"props": ["UserPopoutAvatar"]}, "UserPopoutAvatar": {"props": ["UserPopoutAvatar"]},
"UserPopoutBody": {"strings": ["passportCaret", "setNote", "USER_POPOUT"]}, "UserPopoutBody": {"strings": ["passportCaret", "setNote", "USER_POPOUT"]},
"UserPopoutBodySection": {"strings": [".customStatusActivity", ".canDM", ".hidePersonalInformation"]}, "UserPopoutBodySection": {"strings": [".customStatusActivity", ".canDM", ".hidePersonalInformation"]},
"UserProfileModal": {"lazyLoaded": true}, "UserProfileModal": {"lazyLoaded": true},
"UserProfileModalHeader": {"lazyLoaded": true}, "UserProfileModalHeader": {"lazyLoaded": true},
"UserSettingsAppearance": {"class": "usersettingsappearancepreview"} "UserSettingsAppearance": {"class": "usersettingsappearancepreview"},
"UserThemeBanner": {"strings": [".showPremiumBadgeUpsell", ".isPremiumAtLeast", "PremiumTypes"]}
}, },
"LoadedInComponents": { "LoadedInComponents": {
"AutocompleteChannelResult": "LibraryComponents.AutocompleteItems.Channel", "AutocompleteChannelResult": "LibraryComponents.AutocompleteItems.Channel",

View File

@ -2,7 +2,7 @@
* @name EditUsers * @name EditUsers
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 4.6.5 * @version 4.6.6
* @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
@ -98,6 +98,7 @@ module.exports = (_ => {
HeaderBarContainer: "default", HeaderBarContainer: "default",
ChannelEditorContainer: "render", ChannelEditorContainer: "render",
AutocompleteUserResult: "render", AutocompleteUserResult: "render",
UserThemeBanner: "default",
UserBanner: "default", UserBanner: "default",
UserPopoutAvatar: "UserPopoutAvatar", UserPopoutAvatar: "UserPopoutAvatar",
UsernameSection: "default", UsernameSection: "default",
@ -156,7 +157,6 @@ module.exports = (_ => {
RichUserMention: "UserMention", RichUserMention: "UserMention",
ChannelReply: "default", ChannelReply: "default",
MemberListItem: "render", MemberListItem: "render",
UserHook: "render",
InvitationCard: "render", InvitationCard: "render",
InviteModalUserRow: "default", InviteModalUserRow: "default",
TypingUsers: "render", TypingUsers: "render",
@ -602,6 +602,13 @@ module.exports = (_ => {
} }
} }
processUserThemeBanner (e) {
if (e.instance.props.user && changedUsers[e.instance.props.user.id]) {
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) e.instance.props.bannerSrc = null;
@ -1059,12 +1066,6 @@ module.exports = (_ => {
} }
} }
processUserHook (e) {
if (e.instance.props.user && this.settings.places.guildSettings) {
this.changeUserColor(e.returnvalue.props.children[0], e.instance.props.user.id);
}
}
processGuildSettingsEmoji (e) { processGuildSettingsEmoji (e) {
if (BDFDB.ArrayUtils.is(e.instance.props.emojis) && this.settings.places.guildSettings) { if (BDFDB.ArrayUtils.is(e.instance.props.emojis) && this.settings.places.guildSettings) {
e.instance.props.emojis = [].concat(e.instance.props.emojis); e.instance.props.emojis = [].concat(e.instance.props.emojis);