♻️ Rebuild the call

This commit is contained in:
2025-11-23 00:26:40 +08:00
parent 53f0dcb825
commit 3ad4bb4518
12 changed files with 525 additions and 193 deletions

View File

@@ -212,7 +212,11 @@ class CallNotifier extends _$CallNotifier {
String? _roomId;
String? get roomId => _roomId;
Future<void> joinRoom(String roomId) async {
SnChatRoom? _chatRoom;
SnChatRoom? get chatRoom => _chatRoom;
Future<void> joinRoom(SnChatRoom room) async {
var roomId = room.id;
if (_roomId == roomId && _room != null) {
talker.info('[Call] Call skipped. Already has data');
return;
@@ -223,6 +227,7 @@ class CallNotifier extends _$CallNotifier {
}
}
_roomId = roomId;
_chatRoom = room;
if (_room != null) {
await _room!.disconnect();
await _room!.dispose();

View File

@@ -6,7 +6,7 @@ part of 'call.dart';
// RiverpodGenerator
// **************************************************************************
String _$callNotifierHash() => r'a8ca3f625c0db3ad9992033ae70864ce15efc281';
String _$callNotifierHash() => r'2caee30f42315e539cb4df17c0d464ceed41ffa0';
/// See also [CallNotifier].
@ProviderFor(CallNotifier)