From 93a737b7b154d566b54dbf1946592e302bf85338 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Mon, 22 Apr 2024 17:21:53 +0200 Subject: [PATCH] LastMessageDate Fix --- Library/_res/0BDFDB.data.json | 12 +++++------ .../LastMessageDate/LastMessageDate.plugin.js | 21 ++++++++----------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index aa42d27e6c..45ed51f2ce 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -488,11 +488,10 @@ "UserGenericContextMenu": {"strings": ["USER_ACTIONS_MENU_LABEL", "navId:\"user", ".USER_GENERIC_MENU"], "noSearch": true}, "UserInfo": {"strings": [".botTag", "isMobile:", ".discordTag"]}, "UserMemberContextMenu": {"strings": ["USER_ACTIONS_MENU_LABEL", "navId:\"user", ".GUILD_CHANNEL_USER_MENU"], "noSearch": true}, - "UserMemberSince": {"strings": [".memberSinceContainer", ".USER_PROFILE_DISCORD_MEMBER_SINCE"]}, - "UserMemberSinceSection": {"strings": ["userId:", "headingClassName", ".title", "guildMember:"]}, + "UserMemberSince": {"strings": [".memberSince", ".USER_PROFILE_DISCORD_MEMBER_SINCE"]}, "UserMention": {"strings": ["inlinePreview", "\"@\"", "renderPopout:"]}, "UsernameSection": {"strings": ["shouldCopyOnClick:", ".userTagDiscriminatorNoNickname"]}, - "UserPopout": {"strings": ["{user:", "userId:", "\"Unexpected missing user\")", "getUser"]}, + "UserPopout": {"strings": ["{user:", "userId:", "\"Unexpected missing user\")", "getUser"], "noSearch": true}, "UserPopoutAvatar": {"strings": [".avatarDecorationHint", ".VIEW_PROFILE"], "noSearch": true}, "UserPopoutBody": {"strings": ["customStatusActivity:", "canDM:", "hidePersonalInformation:", "showCopiableUsername:"]}, "UserProfile": {"strings": [".PROFILE_MODAL", "USER_INFO_CONNECTIONS", ".topSection"], "noSearch": true}, @@ -504,7 +503,8 @@ "UserRolesSection": {"strings": [".rolePillBorder", "numRoles", "roleClassName"]}, "UserSummaryItem": {"protos": ["renderMoreUsers", "renderUsers", "renderIcon"]}, "UserSettingsAppearance": {"protos": ["renderTheme", "renderDisplayMode", "renderMessageGroupSpacingSlider"]}, - "UserTheme": {"strings": [".profileColors", "useDefaultClientTheme:"], "noSearch": true}, + "UserTheme": {"strings": [".UserProfileThemeContextProvider", "pendingThemeColors:"], "noSearch": true}, + "UserThemeContainer": {"strings": [".trackUserProfileAction", "guildId:", ".Provider"], "noSearch": true}, "VideoBackground": {"strings": ["backgroundSrc:", "pulseSpeakingIndicator:", ".avatarWrapper"]}, "VoiceUser": {"protos": ["renderPrioritySpeaker", "renderIcons", "renderAvatar"]}, "VoiceUsers": {"strings": ["hidePreview", "previewIsOpen", "Permissions.MOVE_MEMBERS"]} @@ -1438,7 +1438,7 @@ "MenuReactButton": {"props": ["wrapper", "icon", "focused", "button"]}, "MenuSlider": {"props": ["slider", "sliderContainer"]}, "Member": {"props": ["member", "ownerIcon"]}, - "MemberSince": {"props": ["memberSinceContainer", "discordIcon"]}, + "MemberSince": {"props": ["memberSince", "discordIcon"]}, "MembersWrapper": {"props": ["membersWrap", "membersGroup"]}, "Message": {"props": ["message", "mentioned"]}, "MessageAccessory": {"props": ["embedWrapper", "gifFavoriteButton"]}, @@ -2607,7 +2607,7 @@ "memberownericon": ["Member", "ownerIcon"], "memberpremiumicon": ["Member", "premiumIcon"], "members": ["MembersWrapper", "members"], - "membersince": ["MemberSince", "memberSinceContainer"], + "membersince": ["MemberSince", "memberSince"], "membersgroup": ["MembersWrapper", "membersGroup"], "memberswrap": ["MembersWrapper", "membersWrap"], "memberusername": ["Member", "username"], diff --git a/Plugins/LastMessageDate/LastMessageDate.plugin.js b/Plugins/LastMessageDate/LastMessageDate.plugin.js index 9d6ce7958a..3542865c4c 100644 --- a/Plugins/LastMessageDate/LastMessageDate.plugin.js +++ b/Plugins/LastMessageDate/LastMessageDate.plugin.js @@ -2,7 +2,7 @@ * @name LastMessageDate * @author DevilBro * @authorId 278543574059057154 - * @version 1.3.8 + * @version 1.3.9 * @description Displays the Last Message Date of a Member for the current Server/DM in the UserPopout and UserModal * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -102,7 +102,8 @@ module.exports = (_ => { nativeClass: false, name: BDFDB.LibraryComponents.SvgIcon.Names.NUMPAD }); - return BDFDB.ReactUtils.createElement(this.props.isInPopout ? BDFDB.LibraryComponents.UserPopoutSection : BDFDB.ReactUtils.Fragment, { + return BDFDB.ReactUtils.createElement(this.props.isInPopout ? "div" : BDFDB.ReactUtils.Fragment, { + className: this.props.isInPopout && BDFDB.disCN.marginbottom8, children: [ BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Heading, { className: !this.props.isInPopout ? BDFDB.disCN.userprofileinfosectionheader : BDFDB.disCN.userpopoutsectiontitle, @@ -148,11 +149,10 @@ module.exports = (_ => { this.modulePatches = { before: [ - "UserPopout", - "UserProfile" + "UserThemeContainer" ], after: [ - "UserMemberSinceSection", + "UserMemberSince", "UserProfileBody" ] }; @@ -232,11 +232,12 @@ module.exports = (_ => { } } - processUserPopout (e) { - currentPopout = e.instance; + processUserThemeContainer (e) { + if (e.instance.props.layout == "POPOUT") currentPopout = e.instance; + if (e.instance.props.layout == "MODAL") currentProfile = e.instance; } - processUserMemberSinceSection (e) { + processUserMemberSince (e) { if (!currentPopout) return; let user = e.instance.props.user || BDFDB.LibraryStores.UserStore.getUser(e.instance.props.userId); if (!user || user.isNonUserBot()) return; @@ -252,10 +253,6 @@ module.exports = (_ => { ]; } - processUserProfile (e) { - currentProfile = e.instance; - } - processUserProfileBody (e) { if (!currentProfile) return; let user = e.instance.props.user || BDFDB.LibraryStores.UserStore.getUser(e.instance.props.userId);