Skip to content

Commit a1be4e4

Browse files
committed
refactor: rename external js field
1 parent 0bfe534 commit a1be4e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/supabase_flutter/lib/src/hot_restart_cleanup_web.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'dart:js_interop';
33
import 'package:supabase_flutter/supabase_flutter.dart';
44

55
@JS()
6-
external JSFunction? supabaseFlutterWSToClose;
6+
external JSFunction? supabaseFlutterClientToDispose;
77

88
/// Store a function to properly dispose the previous [SupabaseClient] in
99
/// the js context.
@@ -15,22 +15,22 @@ external JSFunction? supabaseFlutterWSToClose;
1515
/// errors and the fact that the events of the old connection may still be
1616
/// logged.
1717
void markClientToDispose(SupabaseClient client) {
18-
void disconnect() {
18+
void dispose() {
1919
client.realtime.disconnect(
2020
code: 1000, reason: 'Closed due to Flutter Web hot-restart');
2121
client.dispose();
2222
}
2323

24-
supabaseFlutterWSToClose = disconnect.toJS;
24+
supabaseFlutterClientToDispose = dispose.toJS;
2525
}
2626

2727
/// Disconnect the previous [SupabaseClient] if it exists.
2828
///
2929
/// This is done by calling the function stored by
3030
/// [markClientToDispose] from the js context
3131
void disposePreviousClient() {
32-
if (supabaseFlutterWSToClose != null) {
33-
supabaseFlutterWSToClose!.callAsFunction();
34-
supabaseFlutterWSToClose = null;
32+
if (supabaseFlutterClientToDispose != null) {
33+
supabaseFlutterClientToDispose!.callAsFunction();
34+
supabaseFlutterClientToDispose = null;
3535
}
3636
}

0 commit comments

Comments
 (0)