diff --git a/lib/cubits/comments/comments_cubit.dart b/lib/cubits/comments/comments_cubit.dart index 14e1b6b..a249c47 100644 --- a/lib/cubits/comments/comments_cubit.dart +++ b/lib/cubits/comments/comments_cubit.dart @@ -113,6 +113,8 @@ class CommentsCubit extends Cubit { state.copyWith( status: CommentsStatus.inProgress, comments: [], + matchedComments: [], + inThreadSearchQuery: '', currentPage: 0, ), ); diff --git a/lib/screens/item/widgets/in_thread_search_icon_button.dart b/lib/screens/item/widgets/in_thread_search_icon_button.dart index 41bcff0..3dfdd70 100644 --- a/lib/screens/item/widgets/in_thread_search_icon_button.dart +++ b/lib/screens/item/widgets/in_thread_search_icon_button.dart @@ -141,6 +141,7 @@ class _InThreadSearchViewState extends State<_InThreadSearchView> { children: [ for (final int i in state.matchedComments) CommentTile( + index: i, comment: state.comments.elementAt(i), fetchMode: FetchMode.lazy, actionable: false, diff --git a/lib/screens/widgets/comment_tile.dart b/lib/screens/widgets/comment_tile.dart index 1267106..6970f8a 100644 --- a/lib/screens/widgets/comment_tile.dart +++ b/lib/screens/widgets/comment_tile.dart @@ -359,7 +359,8 @@ class CommentTile extends StatelessWidget { final CollapseState collapseState = context.read().state; final CommentsState? commentsState = context.tryRead()?.state; - return fetchMode == FetchMode.lazy && + return actionable && + fetchMode == FetchMode.lazy && comment.kids.isNotEmpty && collapseState.collapsed == false && commentsState?.commentIds.contains(comment.kids.first) == false &&