Skip to content

Commit 36219f1

Browse files
authored
fix(core): move get currentChannels before async (#2138)
1 parent 738ec48 commit 36219f1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/stream_chat_flutter_core/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
and directly working with the attachments list.
77
- Added proper userAgent and systemEnvironment information for better diagnostics and analytics.
88

9+
🐞 Fixed
10+
- type '_$Loading<int, Channel>' is not a subtype of type 'Success<int, Channel>' in type cast [#1894](https://github.com/GetStream/stream-chat-flutter/issues/1894)
11+
912
## 9.4.0
1013

1114
- Updated minimum Flutter version to 3.27.4 for the SDK.

packages/stream_chat_flutter_core/lib/src/stream_channel_list_event_handler.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ mixin class StreamChannelListEventHandler {
6767

6868
if (channelId == null || channelType == null) return;
6969

70+
final currentChannels = [...controller.currentItems];
71+
7072
final channel = await controller.getChannel(
7173
id: channelId,
7274
type: channelType,
7375
);
7476

75-
final currentChannels = [...controller.currentItems];
76-
7777
final updatedChannels = [
7878
channel,
7979
...currentChannels..removeWhere((it) => it.cid == channel.cid),

0 commit comments

Comments
 (0)