File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/stream_feeds/lib/src/models Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ class ActivityData implements Identifiable {
5656 }
5757
5858 return copyWith (
59- reactionCount: newLatestReactions.length ,
59+ reactionCount: reactionGroups.totalCount ,
6060 latestReactions: List .unmodifiable (newLatestReactions),
6161 ownReactions: List .unmodifiable (newOwnReactions),
6262 reactionGroups: Map .unmodifiable (newReactionGroups),
@@ -79,7 +79,7 @@ class ActivityData implements Identifiable {
7979 }
8080
8181 return copyWith (
82- reactionCount: newLatestReactions.length ,
82+ reactionCount: reactionGroups.totalCount ,
8383 latestReactions: List .unmodifiable (newLatestReactions),
8484 ownReactions: List .unmodifiable (newOwnReactions),
8585 reactionGroups: Map .unmodifiable (newReactionGroups),
@@ -119,3 +119,8 @@ extension on FeedsReactionData {
119119 }
120120 }
121121}
122+
123+ extension on Map <String , ReactionGroupData > {
124+ int get totalCount =>
125+ values.fold (0 , (sum, reactionGroup) => sum + reactionGroup.count);
126+ }
You can’t perform that action at this time.
0 commit comments