Merge branch 'krille/fix-reactions' into 'main'

fix: Chat view becomes gray for a second on sending reaction

See merge request famedly/fluffychat!789
This commit is contained in:
Krille Fear 2022-03-27 15:31:29 +00:00
commit 2f18fb7bc4

View File

@ -22,12 +22,14 @@ class MessageReactions extends StatelessWidget {
Widget build(BuildContext context) {
final allReactionEvents =
event.aggregatedEvents(timeline, RelationshipTypes.reaction);
final reactionMap = <String?, _ReactionEntry>{};
final reactionMap = <String, _ReactionEntry>{};
final client = Matrix.of(context).client;
for (final e in allReactionEvents) {
if (e.content['m.relates_to'].containsKey('key')) {
final key = e.content['m.relates_to']['key'];
final key = e.content
.tryGetMap<String, dynamic>('m.relates_to')
?.tryGet<String>('key');
if (key != null) {
if (!reactionMap.containsKey(key)) {
reactionMap[key] = _ReactionEntry(
key: key,