fix ChannelListView not retrying error on connection recovered [#504](https://github.com/GetStream/stream-chat-flutter/issues/504)

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2021-07-13 16:51:22 +05:30
committed by xsahil03x
parent dbfe09309a
commit 201a510bf0
5 changed files with 149 additions and 145 deletions
@@ -146,6 +146,8 @@ class ChannelsBlocState extends State<ChannelsBloc>
_paginationEnded = true;
}
} catch (e, stk) {
// reset loading controller
_queryChannelsLoadingController.sink.add(false);
if (_channelsController.hasValue) {
_queryChannelsLoadingController.addError(e, stk);
} else {
@@ -85,6 +85,7 @@ class _LazyLoadScrollViewState extends State<LazyLoadScrollView> {
final extentBefore = notification.metrics.extentBefore;
final extentAfter = notification.metrics.extentAfter;
final scrollingDown = _scrollPosition < pixels;
_scrollPosition = pixels;
if (scrollingDown) {
if (extentAfter <= scrollOffset) {
@@ -97,8 +98,6 @@ class _LazyLoadScrollViewState extends State<LazyLoadScrollView> {
return true;
}
}
_scrollPosition = pixels;
}
if (notification is OverscrollNotification) {
if (notification.overscroll > 0) {
@@ -98,6 +98,8 @@ class MessageSearchBlocState extends State<MessageSearchBloc>
_queryMessagesLoadingController.add(false);
}
} catch (e, stk) {
// reset loading controller
_queryMessagesLoadingController.add(false);
if (_messageResponses.hasValue) {
_queryMessagesLoadingController.addError(e, stk);
} else {
@@ -96,6 +96,8 @@ class UsersBlocState extends State<UsersBloc>
_queryUsersLoadingController.add(false);
}
} catch (e, stk) {
// reset loading controller
_queryUsersLoadingController.add(false);
if (_usersController.hasValue) {
_queryUsersLoadingController.addError(e, stk);
} else {