Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/stream_feeds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## unreleased
- Update follower and following counts on the feed state when receiving follow websocket events.
- Fix FeedsReactionData id for updating reactions in the feed state.

## 0.3.1
- Update API client with renaming `addReaction` to `addActivityReaction` and `deleteReaction` to `deleteActivityReaction`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class FeedsReactionData with _$FeedsReactionData {
/// Creates a new [FeedsReactionData] instance.
const FeedsReactionData({
required this.activityId,
this.commentId,
required this.createdAt,
required this.type,
required this.updatedAt,
Expand All @@ -25,6 +26,8 @@ class FeedsReactionData with _$FeedsReactionData {
@override
final String activityId;

final String? commentId;

/// The date and time when the reaction was created.
@override
final DateTime createdAt;
Expand All @@ -46,7 +49,8 @@ class FeedsReactionData with _$FeedsReactionData {
final Map<String, Object?>? custom;

/// Unique identifier for the reaction, generated from the activity ID and user ID.
String get id => '$activityId${user.id}';
String get id =>
'${user.id}-$type${commentId == null ? '' : '-$commentId'}-$activityId';
}

/// Extension function to convert a [FeedsReactionResponse] to a [FeedsReactionData] model.
Expand All @@ -55,6 +59,7 @@ extension FeedsReactionResponseMapper on FeedsReactionResponse {
FeedsReactionData toModel() {
return FeedsReactionData(
activityId: activityId,
commentId: commentId,
createdAt: createdAt,
type: type,
updatedAt: updatedAt,
Expand Down
Loading