Skip to content

Commit

Permalink
bug fix for index selecting wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
hjiangsu committed Jun 16, 2023
1 parent 72c48e9 commit a0fe55c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/post/pages/post_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PostPage extends StatelessWidget {
listener: (context, state) {
if (state.status == PostStatus.success) {
// Update the community's post
int? postIdIndex = context.read<CommunityBloc>().state.postViews?.indexWhere((postView) => postView.post.id == postView.post.id);
int? postIdIndex = context.read<CommunityBloc>().state.postViews?.indexWhere((communityPostView) => communityPostView.post.id == postView.post.id);
if (postIdIndex != null) {
context.read<CommunityBloc>().state.postViews![postIdIndex] = state.postView!;
}
Expand Down

0 comments on commit a0fe55c

Please sign in to comment.