Merge pull request #414 from GetStream/hotfix/channelsBlocQuery
fix: channels bloc does not perform the call if pagination ended
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## 1.5.4
|
||||||
|
|
||||||
|
- Updated `stream_chat_core` dependency
|
||||||
|
|
||||||
## 1.5.3
|
## 1.5.3
|
||||||
|
|
||||||
- Updated `stream_chat_core` dependency
|
- Updated `stream_chat_core` dependency
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
name: stream_chat_flutter
|
name: stream_chat_flutter
|
||||||
homepage: https://github.com/GetStream/stream-chat-flutter
|
homepage: https://github.com/GetStream/stream-chat-flutter
|
||||||
description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
|
description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
|
||||||
version: 1.5.3
|
version: 1.5.4
|
||||||
repository: https://github.com/GetStream/stream-chat-flutter
|
repository: https://github.com/GetStream/stream-chat-flutter
|
||||||
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
|
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
stream_chat_flutter_core: ^1.5.2
|
stream_chat_flutter_core: ^1.5.3
|
||||||
photo_view: ^0.11.0
|
photo_view: ^0.11.0
|
||||||
rxdart: ^0.25.0
|
rxdart: ^0.25.0
|
||||||
scrollable_positioned_list: ^0.1.8
|
scrollable_positioned_list: ^0.1.8
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
## 1.5.3
|
||||||
|
|
||||||
|
* Fix ChannelsBloc not performing calls if pagination ended
|
||||||
|
|
||||||
## 1.5.2
|
## 1.5.2
|
||||||
|
|
||||||
* Update llc dependency
|
* Update llc dependency
|
||||||
|
|||||||
@@ -95,7 +95,12 @@ class ChannelsBlocState extends State<ChannelsBloc>
|
|||||||
}) async {
|
}) async {
|
||||||
final client = StreamChatCore.of(context).client;
|
final client = StreamChatCore.of(context).client;
|
||||||
|
|
||||||
if (_paginationEnded || _queryChannelsLoadingController.value == true) {
|
final clear = paginationParams == null ||
|
||||||
|
paginationParams.offset == null ||
|
||||||
|
paginationParams.offset == 0;
|
||||||
|
|
||||||
|
if ((!clear && _paginationEnded) ||
|
||||||
|
_queryChannelsLoadingController.value == true) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,9 +109,6 @@ class ChannelsBlocState extends State<ChannelsBloc>
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final clear = paginationParams == null ||
|
|
||||||
paginationParams.offset == null ||
|
|
||||||
paginationParams.offset == 0;
|
|
||||||
final oldChannels = List<Channel>.from(channels ?? []);
|
final oldChannels = List<Channel>.from(channels ?? []);
|
||||||
var newChannels = <Channel>[];
|
var newChannels = <Channel>[];
|
||||||
await for (final channels in client.queryChannels(
|
await for (final channels in client.queryChannels(
|
||||||
@@ -148,7 +150,11 @@ class ChannelsBlocState extends State<ChannelsBloc>
|
|||||||
final client = StreamChatCore.of(context).client;
|
final client = StreamChatCore.of(context).client;
|
||||||
|
|
||||||
if (!widget.lockChannelsOrder) {
|
if (!widget.lockChannelsOrder) {
|
||||||
_subscriptions.add(client.on(EventType.messageNew).listen((e) {
|
_subscriptions.add(client
|
||||||
|
.on(
|
||||||
|
EventType.messageNew,
|
||||||
|
)
|
||||||
|
.listen((e) {
|
||||||
final newChannels = List<Channel>.from(channels ?? []);
|
final newChannels = List<Channel>.from(channels ?? []);
|
||||||
final index = newChannels.indexWhere((c) => c.cid == e.cid);
|
final index = newChannels.indexWhere((c) => c.cid == e.cid);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
name: stream_chat_flutter_core
|
name: stream_chat_flutter_core
|
||||||
homepage: https://github.com/GetStream/stream-chat-flutter
|
homepage: https://github.com/GetStream/stream-chat-flutter
|
||||||
description: Stream Chat official Flutter SDK Core. Build your own chat experience using Dart and Flutter.
|
description: Stream Chat official Flutter SDK Core. Build your own chat experience using Dart and Flutter.
|
||||||
version: 1.5.2
|
version: 1.5.3
|
||||||
repository: https://github.com/GetStream/stream-chat-flutter
|
repository: https://github.com/GetStream/stream-chat-flutter
|
||||||
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
|
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user