mirror of
https://github.com/Livinglist/Hacki.git
synced 2025-08-06 18:24:42 +08:00
fix in-thread search. (#294)
This commit is contained in:
@ -113,6 +113,8 @@ class CommentsCubit extends Cubit<CommentsState> {
|
||||
state.copyWith(
|
||||
status: CommentsStatus.inProgress,
|
||||
comments: <Comment>[],
|
||||
matchedComments: <int>[],
|
||||
inThreadSearchQuery: '',
|
||||
currentPage: 0,
|
||||
),
|
||||
);
|
||||
|
@ -141,6 +141,7 @@ class _InThreadSearchViewState extends State<_InThreadSearchView> {
|
||||
children: <Widget>[
|
||||
for (final int i in state.matchedComments)
|
||||
CommentTile(
|
||||
index: i,
|
||||
comment: state.comments.elementAt(i),
|
||||
fetchMode: FetchMode.lazy,
|
||||
actionable: false,
|
||||
|
@ -359,7 +359,8 @@ class CommentTile extends StatelessWidget {
|
||||
final CollapseState collapseState = context.read<CollapseCubit>().state;
|
||||
final CommentsState? commentsState =
|
||||
context.tryRead<CommentsCubit>()?.state;
|
||||
return fetchMode == FetchMode.lazy &&
|
||||
return actionable &&
|
||||
fetchMode == FetchMode.lazy &&
|
||||
comment.kids.isNotEmpty &&
|
||||
collapseState.collapsed == false &&
|
||||
commentsState?.commentIds.contains(comment.kids.first) == false &&
|
||||
|
Reference in New Issue
Block a user