This commit is contained in:
Half-Shot
2024-12-17 14:10:12 +00:00
parent 3a094342d3
commit 770cd9ddf7

View File

@@ -47,13 +47,12 @@ export default function useReactionsReader(rtcSession: MatrixRTCSession): {
);
reactionsSubject$.current
.pipe(delay(REACTION_ACTIVE_TIME_MS + 50))
.pipe(delay(REACTION_ACTIVE_TIME_MS))
.subscribe((reactions) => {
const date = new Date();
const nextEntries = Object.fromEntries(
Object.entries(reactions).filter(([_, hr]) => hr.expireAfter < date),
Object.entries(reactions).filter(([_, hr]) => hr.expireAfter > date),
);
console.log("Filtering", nextEntries);
if (Object.keys(reactions).length === Object.keys(nextEntries).length) {
return;
}