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(
|
state.copyWith(
|
||||||
status: CommentsStatus.inProgress,
|
status: CommentsStatus.inProgress,
|
||||||
comments: <Comment>[],
|
comments: <Comment>[],
|
||||||
|
matchedComments: <int>[],
|
||||||
|
inThreadSearchQuery: '',
|
||||||
currentPage: 0,
|
currentPage: 0,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -141,6 +141,7 @@ class _InThreadSearchViewState extends State<_InThreadSearchView> {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
for (final int i in state.matchedComments)
|
for (final int i in state.matchedComments)
|
||||||
CommentTile(
|
CommentTile(
|
||||||
|
index: i,
|
||||||
comment: state.comments.elementAt(i),
|
comment: state.comments.elementAt(i),
|
||||||
fetchMode: FetchMode.lazy,
|
fetchMode: FetchMode.lazy,
|
||||||
actionable: false,
|
actionable: false,
|
||||||
|
@ -359,7 +359,8 @@ class CommentTile extends StatelessWidget {
|
|||||||
final CollapseState collapseState = context.read<CollapseCubit>().state;
|
final CollapseState collapseState = context.read<CollapseCubit>().state;
|
||||||
final CommentsState? commentsState =
|
final CommentsState? commentsState =
|
||||||
context.tryRead<CommentsCubit>()?.state;
|
context.tryRead<CommentsCubit>()?.state;
|
||||||
return fetchMode == FetchMode.lazy &&
|
return actionable &&
|
||||||
|
fetchMode == FetchMode.lazy &&
|
||||||
comment.kids.isNotEmpty &&
|
comment.kids.isNotEmpty &&
|
||||||
collapseState.collapsed == false &&
|
collapseState.collapsed == false &&
|
||||||
commentsState?.commentIds.contains(comment.kids.first) == false &&
|
commentsState?.commentIds.contains(comment.kids.first) == false &&
|
||||||
|
Reference in New Issue
Block a user