Skip to content

Commit

Permalink
Fix issue with deferred comments
Browse files Browse the repository at this point in the history
  • Loading branch information
micahmo committed Feb 1, 2024
1 parent 1fedabe commit d2a7abf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/post/bloc/post_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,9 @@ class PostBloc extends Bloc<PostEvent, PostState> {
if (!state.hasReachedCommentEnd && state.commentCount == state.postView!.postView.counts.comments) {
emit(state.copyWith(status: state.status, hasReachedCommentEnd: true));
}
if (event.commentParentId != null) {
// If we come here, we've determined that we've already loaded all of the comments.
// But we're currently being asked to load some children.
// Therefore we will treat this as an error.
throw Exception(AppLocalizations.of(GlobalContext.context)!.unableToLoadReplies);
if (event.commentParentId == null) {
return;
}
return;
}
emit(state.copyWith(status: PostStatus.refreshing, newlyCreatedCommentId: state.newlyCreatedCommentId));

Expand Down

0 comments on commit d2a7abf

Please sign in to comment.