Skip to content

Commit 0bfe534

Browse files
committed
refactor: rename methods
1 parent 08ce68c commit 0bfe534

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:supabase_flutter/supabase_flutter.dart';
22

3-
void markRealtimeClientToBeDisconnected(SupabaseClient client) {}
3+
void markClientToDispose(SupabaseClient client) {}
44

5-
void disconnectPreviousRealtimeClient() {}
5+
void disposePreviousClient() {}

packages/supabase_flutter/lib/src/hot_restart_cleanup_web.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ external JSFunction? supabaseFlutterWSToClose;
1414
/// connections to be still running and causes unexpected behavior like type
1515
/// errors and the fact that the events of the old connection may still be
1616
/// logged.
17-
void markRealtimeClientToBeDisconnected(SupabaseClient client) {
17+
void markClientToDispose(SupabaseClient client) {
1818
void disconnect() {
1919
client.realtime.disconnect(
2020
code: 1000, reason: 'Closed due to Flutter Web hot-restart');
@@ -27,8 +27,8 @@ void markRealtimeClientToBeDisconnected(SupabaseClient client) {
2727
/// Disconnect the previous [SupabaseClient] if it exists.
2828
///
2929
/// This is done by calling the function stored by
30-
/// [markRealtimeClientToBeDisconnected] from the js context
31-
void disconnectPreviousRealtimeClient() {
30+
/// [markClientToDispose] from the js context
31+
void disposePreviousClient() {
3232
if (supabaseFlutterWSToClose != null) {
3333
supabaseFlutterWSToClose!.callAsFunction();
3434
supabaseFlutterWSToClose = null;

packages/supabase_flutter/lib/src/supabase.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ class Supabase with WidgetsBindingObserver {
210210
// Close any previous realtime client that may still be connected due to
211211
// flutter web hot-restart.
212212
if (kDebugMode) {
213-
disconnectPreviousRealtimeClient();
214-
markRealtimeClientToBeDisconnected(client);
213+
disposePreviousClient();
214+
markClientToDispose(client);
215215
}
216216
_widgetsBindingInstance?.addObserver(this);
217217
_initialized = true;

0 commit comments

Comments
 (0)