[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}
|
lang={language}
|
||||||
htmlString={content}
|
htmlString={content}
|
||||||
extraEmojis={status.get('emojis')}
|
extraEmojis={status.get('emojis')}
|
||||||
onElement={this.handleElement.bind(this)}
|
onElement={this.handleElement}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{poll}
|
{poll}
|
||||||
@ -384,7 +384,7 @@ class StatusContent extends PureComponent {
|
|||||||
lang={language}
|
lang={language}
|
||||||
htmlString={content}
|
htmlString={content}
|
||||||
extraEmojis={status.get('emojis')}
|
extraEmojis={status.get('emojis')}
|
||||||
onElement={this.handleElement.bind(this)}
|
onElement={this.handleElement}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{poll}
|
{poll}
|
||||||
|
|||||||
@ -46,11 +46,15 @@ export const EmbeddedStatusContent: React.FC<{
|
|||||||
() => (status.get('mentions') as List<Mention>).toJS(),
|
() => (status.get('mentions') as List<Mention>).toJS(),
|
||||||
[status],
|
[status],
|
||||||
);
|
);
|
||||||
const htmlHandlers = useElementHandledLink({
|
const hrefToMention = useCallback(
|
||||||
hashtagAccountId: status.get('account') as string | undefined,
|
(href: string) => {
|
||||||
hrefToMention(href) {
|
|
||||||
return mentions.find((item) => item.url === href);
|
return mentions.find((item) => item.url === href);
|
||||||
},
|
},
|
||||||
|
[mentions],
|
||||||
|
);
|
||||||
|
const htmlHandlers = useElementHandledLink({
|
||||||
|
hashtagAccountId: status.get('account') as string | undefined,
|
||||||
|
hrefToMention,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleContentRef = useCallback(
|
const handleContentRef = useCallback(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user