fix(MutualGroupDMs): properly pass props (#2457)

Co-authored-by: vee <vendicated@riseup.net>
This commit is contained in:
Amia 2024-05-14 03:22:49 +02:00 committed by GitHub
parent 9621dc7bb3
commit bd6f9e6f32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,12 +56,12 @@ export default definePlugin({
find: ".UserProfileSections.USER_INFO_CONNECTIONS:", find: ".UserProfileSections.USER_INFO_CONNECTIONS:",
replacement: { replacement: {
match: /(?<={user:(\i),onClose:(\i)}\);)(?=case \i\.\i\.MUTUAL_FRIENDS)/, match: /(?<={user:(\i),onClose:(\i)}\);)(?=case \i\.\i\.MUTUAL_FRIENDS)/,
replace: "case \"MUTUAL_GDMS\":return $self.renderMutualGDMs($1,$2);" replace: "case \"MUTUAL_GDMS\":return $self.renderMutualGDMs({user: $1, onClose: $2});"
} }
} }
], ],
renderMutualGDMs: ErrorBoundary.wrap((user: User, onClose: () => void) => { renderMutualGDMs: ErrorBoundary.wrap(({ user, onClose }: { user: User, onClose: () => void; }) => {
const entries = ChannelStore.getSortedPrivateChannels().filter(c => c.isGroupDM() && c.recipients.includes(user.id)).map(c => ( const entries = ChannelStore.getSortedPrivateChannels().filter(c => c.isGroupDM() && c.recipients.includes(user.id)).map(c => (
<Clickable <Clickable
className={ProfileListClasses.listRow} className={ProfileListClasses.listRow}