🐛 Fix call unnesssary rejoining

This commit is contained in:
LittleSheep 2025-06-15 00:18:10 +08:00
parent 2fac5e5383
commit a7cb7170b8
2 changed files with 4 additions and 1 deletions

View File

@ -230,6 +230,9 @@ class CallNotifier extends _$CallNotifier {
String? get roomId => _roomId; String? get roomId => _roomId;
Future<void> joinRoom(String roomId) async { Future<void> joinRoom(String roomId) async {
if (_roomId == roomId && _room != null) {
return;
}
_roomId = roomId; _roomId = roomId;
if (_room != null) { if (_room != null) {
await _room!.disconnect(); await _room!.disconnect();

View File

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