From a77ef0267711b68a163107cddffbe7079f025bb5 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 17 Jun 2021 10:12:45 +0200 Subject: [PATCH] cleanup --- src/matrix/room/timeline/Timeline.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/matrix/room/timeline/Timeline.js b/src/matrix/room/timeline/Timeline.js index 00bdb1e1..0ce51920 100644 --- a/src/matrix/room/timeline/Timeline.js +++ b/src/matrix/room/timeline/Timeline.js @@ -212,17 +212,13 @@ export class Timeline { // this will work because we set relatedEventId when removing remote echos if (pee.relatedEventId) { const relationTarget = entries.find(e => e.id === pee.relatedEventId); - if (relationTarget) { - // no need to emit here as this entry is about to be added - relationTarget.addLocalRelation(pee); - } + // no need to emit here as this entry is about to be added + relationTarget?.addLocalRelation(pee); } if (pee.redactingEntry) { const eventId = pee.redactingEntry.relatedEventId; const relationTarget = entries.find(e => e.id === eventId); - if (relationTarget) { - relationTarget.addLocalRelation(pee); - } + relationTarget?.addLocalRelation(pee); } } }