Use localChannel if present instead of creating a new

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2020-12-17 17:10:45 +05:30
parent e17a3c30b7
commit 84aa3fbb87
3 changed files with 225 additions and 199 deletions
+4 -3
View File
@@ -335,10 +335,11 @@ class _ChannelListPageState extends State<ChannelListPage> {
onItemTap: (messageResponse) async {
final client = StreamChat.of(context).client;
final message = messageResponse.message;
final channel = Channel.fromState(
client,
ChannelState(channel: messageResponse.channel),
final channel = client.channel(
messageResponse.channel.type,
id: messageResponse.channel.id,
);
await channel.watch();
Navigator.pushNamed(
context,
Routes.CHANNEL_PAGE,