fix MutualGroupDMs (#2964)

Co-authored-by: v <vendicated@riseup.net>
This commit is contained in:
sadan4 2024-10-22 22:28:30 -04:00 committed by GitHub
parent 0af820c874
commit 553293ceee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,7 +28,7 @@ const SelectedChannelActionCreators = findByPropsLazy("selectPrivateChannel");
const UserUtils = findByPropsLazy("getGlobalName"); const UserUtils = findByPropsLazy("getGlobalName");
const ProfileListClasses = findByPropsLazy("emptyIconFriends", "emptyIconGuilds"); const ProfileListClasses = findByPropsLazy("emptyIconFriends", "emptyIconGuilds");
const ExpandableList = findComponentByCodeLazy(".mutualFriendItem]"); const ExpandableList = findComponentByCodeLazy('"PRESS_SECTION"');
const GuildLabelClasses = findByPropsLazy("guildNick", "guildAvatarWithoutIcon"); const GuildLabelClasses = findByPropsLazy("guildNick", "guildAvatarWithoutIcon");
function getGroupDMName(channel: Channel) { function getGroupDMName(channel: Channel) {
@ -142,16 +142,15 @@ export default definePlugin({
const mutualGDms = getMutualGroupDms(user.id); const mutualGDms = getMutualGroupDms(user.id);
if (mutualGDms.length === 0) return null; if (mutualGDms.length === 0) return null;
const header = getMutualGDMCountText(user);
return ( return (
<> <>
{Divider} {Divider}
<ExpandableList <ExpandableList
className={listStyle} listClassName={listStyle}
header={header} header={"Mutual Groups"}
isLoadingHeader={false} isLoading={false}
children={renderClickableGDMs(mutualGDms, () => { })} items={renderClickableGDMs(mutualGDms, () => { })}
/> />
</> </>
); );