mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-21 04:17:01 -04:00
Option to transform emotes/stickers in compound messages (#876)
+ ContextMenu refactor to not call callbacks for same children multiple times Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
parent
cfe41ef656
commit
e34da54271
9 changed files with 69 additions and 112 deletions
|
@ -80,12 +80,7 @@ function openImage(url: string) {
|
|||
));
|
||||
}
|
||||
|
||||
const seen = new WeakSet();
|
||||
|
||||
const UserContext: NavContextMenuPatchCallback = (children, { user, guildId }: UserContextProps) => {
|
||||
if (seen.has(children)) return;
|
||||
seen.add(children);
|
||||
|
||||
const memberAvatar = GuildMemberStore.getMember(guildId!, user.id)?.avatar || null;
|
||||
|
||||
children.splice(1, 0, (
|
||||
|
@ -111,9 +106,6 @@ const UserContext: NavContextMenuPatchCallback = (children, { user, guildId }: U
|
|||
};
|
||||
|
||||
const GuildContext: NavContextMenuPatchCallback = (children, { guild: { id, icon, banner } }: GuildContextProps) => {
|
||||
if (seen.has(children)) return;
|
||||
seen.add(children);
|
||||
|
||||
if (!banner && !icon) return;
|
||||
|
||||
// before copy id (if it exists)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue