🐛 Fix websocket will put message in wrong channel
This commit is contained in:
parent
25942c2338
commit
acf4e634fe
@ -74,6 +74,7 @@ class ChatMessageController extends ChangeNotifier {
|
|||||||
_wsSubscription = _ws.stream.stream.listen((event) {
|
_wsSubscription = _ws.stream.stream.listen((event) {
|
||||||
switch (event.method) {
|
switch (event.method) {
|
||||||
case 'events.new':
|
case 'events.new':
|
||||||
|
if (event.payload?['channel_id'] != channel?.id) break;
|
||||||
final payload = SnChatMessage.fromJson(event.payload!);
|
final payload = SnChatMessage.fromJson(event.payload!);
|
||||||
_addMessage(payload);
|
_addMessage(payload);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user