diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ab4ae7..aa5cc93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ +## 0.1.1 + +- fix: if you switch tabs very quickly before the initial gif fetch then you will get stuck in an endless loop and crash the app. + +[All Code Changes](https://github.com/Flyclops/tenor_flutter/compare/0.1.0...0.1.1) + ## 0.1.0 - feat: Integrate [tenor_dart's](https://pub.dev/packages/tenor_dart) new `TenorResult.source` parameter to track which tab the GIF was selected from for analytics - fix: not being able to scroll down to load more on tablets or when using display zoom on iPad - refactor: `TenorViewEmojis`, `TenorViewGifs`, `TenorViewStickers` and `TenorTabView` now have a `gifsPerRow` parameter instead of `mediaWidth` to be more explicit and support a wider range of devices -[All Code Changes](https://github.com/Flyclops/tenor_flutter/compare/0.0.5...0.0.6) +[All Code Changes](https://github.com/Flyclops/tenor_flutter/compare/0.0.5...0.1.0) ## 0.0.5 diff --git a/lib/src/components/tab_view.dart b/lib/src/components/tab_view.dart index ff6c536..a6a453e 100644 --- a/lib/src/components/tab_view.dart +++ b/lib/src/components/tab_view.dart @@ -271,6 +271,11 @@ class _TenorTabViewState extends State // Wait for a frame so that we can ensure that `scrollController` is attached WidgetsBinding.instance.addPostFrameCallback((_) async { while (_scrollController.position.extentAfter == 0) { + // Stop trying to load more and exit the loop if: + // 1 - the selected tab has changed + // 2 - there are no more gifs to load + if (_tabProvider.selectedTab != tab || !_hasMoreGifs) return; + await _loadMore(); } }); diff --git a/pubspec.yaml b/pubspec.yaml index 98380c6..03e4c08 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: tenor_flutter -version: 0.1.0 +version: 0.1.1 description: An opinionated yet customizable Flutter package for searching and selecting from a list of GIFs/Stickers from the Tenor GIF search API. homepage: https://github.com/flyclops repository: https://github.com/flyclops/tenor_flutter