potential loading time optimization

This commit is contained in:
Henry Hiles 2026-04-10 16:33:53 -04:00
commit 07decc10e2
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -68,15 +68,17 @@ class MessageController extends AsyncNotifier<Message?> {
final replyId = final replyId =
config.event.content["m.relates_to"]?["m.in_reply_to"]?["event_id"]; config.event.content["m.relates_to"]?["m.in_reply_to"]?["event_id"];
final reactionEvents = await ref final reactionEvents = event.reactions.isEmpty
.watch(ClientController.provider.notifier) ? null
.getRelatedEvents( : await ref
GetRelatedEventsRequest( .watch(ClientController.provider.notifier)
roomId: config.room.metadata!.id, .getRelatedEvents(
eventId: config.event.eventId, GetRelatedEventsRequest(
relationType: "m.annotation", roomId: config.room.metadata!.id,
), eventId: config.event.eventId,
); relationType: "m.annotation",
),
);
final reactions = reactionEvents final reactions = reactionEvents
?.where((event) => event.redactedBy == null) ?.where((event) => event.redactedBy == null)