Skip to content

Commit

Permalink
Removed cancelToken.isCancelled logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bizz84 committed Apr 12, 2024
1 parent 9dc6f05 commit 5f46846
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions lib/src/features/movies/data/movies_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ Future<TMDBMoviesResponse> fetchMovies(
cancelToken: cancelToken,
);
} else {
// Debounce the request. By having this delay, consumers can subscribe to
// different parameters. In which case, this request will be aborted.
await Future.delayed(const Duration(milliseconds: 500));
if (cancelToken.isCancelled) throw AbortedException();
// use search endpoint
return moviesRepo.searchMovies(
queryData: queryData,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/features/movies/data/movies_repository.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5f46846

Please sign in to comment.