From a7cb7170b8912a18276ff2abd8c0500b88fd8ea8 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 15 Jun 2025 00:18:10 +0800 Subject: [PATCH] :bug: Fix call unnesssary rejoining --- lib/pods/call.dart | 3 +++ lib/pods/call.g.dart | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pods/call.dart b/lib/pods/call.dart index 46ca4c4..fc155fc 100644 --- a/lib/pods/call.dart +++ b/lib/pods/call.dart @@ -230,6 +230,9 @@ class CallNotifier extends _$CallNotifier { String? get roomId => _roomId; Future joinRoom(String roomId) async { + if (_roomId == roomId && _room != null) { + return; + } _roomId = roomId; if (_room != null) { await _room!.disconnect(); diff --git a/lib/pods/call.g.dart b/lib/pods/call.g.dart index ce42c8b..2acdcea 100644 --- a/lib/pods/call.g.dart +++ b/lib/pods/call.g.dart @@ -6,7 +6,7 @@ part of 'call.dart'; // RiverpodGenerator // ************************************************************************** -String _$callNotifierHash() => r'2082a572b5cfb4bf929dc1ed492c52cd2735452e'; +String _$callNotifierHash() => r'e04cea314c823e407d49fd616d90d77491232c12'; /// See also [CallNotifier]. @ProviderFor(CallNotifier)