Reactions: Optimize polling (#4322)
This commit is contained in:
parent
fd62fdeba0
commit
2bed347f28
@ -268,10 +268,13 @@ const MessageList: FC<OwnProps & StateProps> = ({
|
|||||||
}, [messageIds, messagesById, type, isServiceNotificationsChat, isForum, threadId, isChatWithSelf]);
|
}, [messageIds, messagesById, type, isServiceNotificationsChat, isForum, threadId, isChatWithSelf]);
|
||||||
|
|
||||||
useInterval(() => {
|
useInterval(() => {
|
||||||
if (!messageIds || !messagesById || type === 'scheduled') {
|
if (!messageIds || !messagesById || type === 'scheduled') return;
|
||||||
return;
|
if (!isChannelChat && !isGroupChat) return;
|
||||||
}
|
|
||||||
const ids = messageIds.filter((id) => messagesById[id]?.reactions?.results.length);
|
const ids = messageIds.filter((id) => {
|
||||||
|
const message = messagesById[id];
|
||||||
|
return message.reactions?.results.length && !message.content.action;
|
||||||
|
});
|
||||||
|
|
||||||
if (!ids.length) return;
|
if (!ids.length) return;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user