Skip to content

Commit

Permalink
fix ShowConnections & FakeProfileThemes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vendicated committed Jun 26, 2024
1 parent bc0d4a8 commit 14e1197
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/plugins/fakeProfileThemes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ interface ProfileModalProps {
}

const ColorPicker = findComponentByCodeLazy<ColorPickerProps>(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR", ".BACKGROUND_PRIMARY)");
const ProfileModal = findComponentByCodeLazy<ProfileModalProps>('"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",
Expand Down
8 changes: 5 additions & 3 deletions src/plugins/mutualGroupDMs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"}),'
}
},
{
Expand All @@ -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)/,
Expand All @@ -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 => (
<Clickable
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/showConnections/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default definePlugin({
}
},
{
find: '"BiteSizeProfileBody"',
find: /\.BITE_SIZE,onOpenProfile:\i,usernameIcon:/,
replacement: {
match: /currentUser:\i,guild:\i,onOpenProfile:.+?}\)(?=])(?<=user:(\i),bio:null==(\i)\?.+?)/,
replace: "$&,$self.profilePopoutComponent({ user: $1, displayProfile: $2, simplified: true })"
Expand Down

0 comments on commit 14e1197

Please sign in to comment.