File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
packages/stream_feeds/lib/src/state Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff 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,
Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments