From 14e11973efc6880fcf6f649a00ec2df5d5e788c3 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 26 Jun 2024 18:40:21 +0200 Subject: [PATCH] fix ShowConnections & FakeProfileThemes --- src/plugins/fakeProfileThemes/index.tsx | 4 ++-- src/plugins/mutualGroupDMs/index.tsx | 8 +++++--- src/plugins/showConnections/index.tsx | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/plugins/fakeProfileThemes/index.tsx b/src/plugins/fakeProfileThemes/index.tsx index 31fc71a9..85aadca1 100644 --- a/src/plugins/fakeProfileThemes/index.tsx +++ b/src/plugins/fakeProfileThemes/index.tsx @@ -109,9 +109,9 @@ interface ProfileModalProps { } const ColorPicker = findComponentByCodeLazy(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR", ".BACKGROUND_PRIMARY)"); -const ProfileModal = findComponentByCodeLazy('"ProfileCustomizationPreview"'); +const ProfileModal = findComponentByCodeLazy("isTryItOutFlow:", "pendingThemeColors:", "avatarDecorationOverride:", ".CUSTOM_STATUS"); -const requireColorPicker = extractAndLoadChunksLazy(["USER_SETTINGS_PROFILE_COLOR_DEFAULT_BUTTON.format"], /createPromise:\(\)=>\i\.\i\("?(.+?)"?\).then\(\i\.bind\(\i,"?(.+?)"?\)\)/); +const requireColorPicker = extractAndLoadChunksLazy(["USER_SETTINGS_PROFILE_COLOR_DEFAULT_BUTTON.format"], /createPromise:\(\)=>\i\.\i(\("?.+?"?\)).then\(\i\.bind\(\i,"?(.+?)"?\)\)/); export default definePlugin({ name: "FakeProfileThemes", diff --git a/src/plugins/mutualGroupDMs/index.tsx b/src/plugins/mutualGroupDMs/index.tsx index b20cf270..0fbf41e9 100644 --- a/src/plugins/mutualGroupDMs/index.tsx +++ b/src/plugins/mutualGroupDMs/index.tsx @@ -49,7 +49,7 @@ export default definePlugin({ find: ".Messages.MUTUAL_GUILDS_WITH_END_COUNT", // Note: the module is lazy-loaded replacement: { match: /(?<=\.tabBarItem.{0,50}MUTUAL_GUILDS.+?}\),)(?=.+?(\(0,\i\.jsxs?\)\(.{0,100}id:))/, - replace: '(arguments[0].user.bot||arguments[0].isCurrentUser)?null:$1"MUTUAL_GDMS",children:"Mutual Groups"}),' + replace: '$self.isBotOrSelf(arguments[0].user)?null:$1"MUTUAL_GDMS",children:"Mutual Groups"}),' } }, { @@ -60,11 +60,11 @@ export default definePlugin({ } }, { - find: ".USER_INFO,subsection:", + find: ".MUTUAL_FRIENDS?(", replacement: [ { match: /(?<=onItemSelect:\i,children:)(\i)\.map/, - replace: "[...$1, {section:'MUTUAL_GDMS',text:'Mutual Groups'}].map" + replace: "[...$1, ...($self.isBotOrSelf(arguments[0].user) ? [] : [{section:'MUTUAL_GDMS',text:'Mutual Groups'}])].map" }, { match: /\(0,\i\.jsx\)\(\i,\{items:\i,section:(\i)/, @@ -74,6 +74,8 @@ export default definePlugin({ } ], + isBotOrSelf: (user: User) => user.bot || user.id === UserStore.getCurrentUser().id, + renderMutualGDMs: ErrorBoundary.wrap(({ user, onClose }: { user: User, onClose: () => void; }) => { const entries = ChannelStore.getSortedPrivateChannels().filter(c => c.isGroupDM() && c.recipients.includes(user.id)).map(c => (