[Glitch] Emoji: Fix unneeded re-renders when StatusContent changes
Port 6e2973aa2d3dc9466f2cc9b352e0eb2b260bf463 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
af1b658c20
commit
8b3ff4f8b1
@ -366,7 +366,7 @@ class StatusContent extends PureComponent {
|
||||
lang={language}
|
||||
htmlString={content}
|
||||
extraEmojis={status.get('emojis')}
|
||||
onElement={this.handleElement.bind(this)}
|
||||
onElement={this.handleElement}
|
||||
/>
|
||||
|
||||
{poll}
|
||||
@ -384,7 +384,7 @@ class StatusContent extends PureComponent {
|
||||
lang={language}
|
||||
htmlString={content}
|
||||
extraEmojis={status.get('emojis')}
|
||||
onElement={this.handleElement.bind(this)}
|
||||
onElement={this.handleElement}
|
||||
/>
|
||||
|
||||
{poll}
|
||||
|
||||
@ -46,11 +46,15 @@ export const EmbeddedStatusContent: React.FC<{
|
||||
() => (status.get('mentions') as List<Mention>).toJS(),
|
||||
[status],
|
||||
);
|
||||
const htmlHandlers = useElementHandledLink({
|
||||
hashtagAccountId: status.get('account') as string | undefined,
|
||||
hrefToMention(href) {
|
||||
const hrefToMention = useCallback(
|
||||
(href: string) => {
|
||||
return mentions.find((item) => item.url === href);
|
||||
},
|
||||
[mentions],
|
||||
);
|
||||
const htmlHandlers = useElementHandledLink({
|
||||
hashtagAccountId: status.get('account') as string | undefined,
|
||||
hrefToMention,
|
||||
});
|
||||
|
||||
const handleContentRef = useCallback(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user