Tidy up useEffect

This commit is contained in:
Half-Shot
2024-10-28 16:23:17 +00:00
parent 4a712dcaa2
commit ba921f8c67
+3 -5
View File
@@ -95,7 +95,6 @@ export const ReactionsProvider = ({
return allEvents.length > 0 ? allEvents[0] : undefined; return allEvents.length > 0 ? allEvents[0] : undefined;
}; };
const fetchReactions = (): void => {
for (const m of memberships) { for (const m of memberships) {
if (!m.sender || !m.eventId) { if (!m.sender || !m.eventId) {
continue; continue;
@@ -115,10 +114,9 @@ export const ReactionsProvider = ({
} }
} }
} }
}; // Deliberately ignoring addRaisedHand which was causing looping.
// eslint-disable-next-line react-hooks/exhaustive-deps
void fetchReactions(); }, [room, memberships]);
}, [room, addRaisedHand, memberships]);
useEffect(() => { useEffect(() => {
const handleReactionEvent = (event: MatrixEvent): void => { const handleReactionEvent = (event: MatrixEvent): void => {