Skip to content

Commit e5cd7df

Browse files
committed
chore: review changes
1 parent a130241 commit e5cd7df

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

packages/stream_feeds/lib/src/state/activity_list_state.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class ActivityListStateNotifier extends StateNotifier<ActivityListState> {
283283
state = state.copyWith(activities: updatedActivities);
284284
}
285285

286-
/// Handles when a poll vote is changed.
286+
/// Handles when a poll answer is removed.
287287
void onPollAnswerRemoved(PollData poll, PollVoteData answer) {
288288
final updatedActivities = state.activities.updateWhere(
289289
(it) => it.poll?.id == poll.id,

packages/stream_feeds/lib/src/state/event/handler/poll_list_event_handler.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class PollListEventHandler implements StateEventHandler {
4747
return state.onPollRemoved(poll.id);
4848
}
4949

50-
return state.onPollClosed(poll);
50+
return state.onPollClosed(poll.id);
5151
}
5252

5353
if (event is api.PollVoteCastedFeedEvent) {

packages/stream_feeds/lib/src/state/poll_list_state.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ class PollListStateNotifier extends StateNotifier<PollListState> {
5959
state = state.copyWith(polls: updatedPolls);
6060
}
6161

62-
void onPollClosed(PollData poll) {
62+
/// Handles the closure of a poll by ID.
63+
void onPollClosed(String pollId) {
6364
final updatedPolls = state.polls.updateWhere(
64-
(it) => it.id == poll.id,
65-
update: (it) => poll.copyWith(isClosed: true),
65+
(it) => it.id == pollId,
66+
update: (it) => it.copyWith(isClosed: true),
6667
compare: pollsSort.compare,
6768
);
6869

0 commit comments

Comments
 (0)