File tree 1 file changed +6
-6
lines changed
packages/supabase_flutter/lib/src 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import 'dart:js_interop';
3
3
import 'package:supabase_flutter/supabase_flutter.dart' ;
4
4
5
5
@JS ()
6
- external JSFunction ? supabaseFlutterWSToClose ;
6
+ external JSFunction ? supabaseFlutterClientToDispose ;
7
7
8
8
/// Store a function to properly dispose the previous [SupabaseClient] in
9
9
/// the js context.
@@ -15,22 +15,22 @@ external JSFunction? supabaseFlutterWSToClose;
15
15
/// errors and the fact that the events of the old connection may still be
16
16
/// logged.
17
17
void markClientToDispose (SupabaseClient client) {
18
- void disconnect () {
18
+ void dispose () {
19
19
client.realtime.disconnect (
20
20
code: 1000 , reason: 'Closed due to Flutter Web hot-restart' );
21
21
client.dispose ();
22
22
}
23
23
24
- supabaseFlutterWSToClose = disconnect .toJS;
24
+ supabaseFlutterClientToDispose = dispose .toJS;
25
25
}
26
26
27
27
/// Disconnect the previous [SupabaseClient] if it exists.
28
28
///
29
29
/// This is done by calling the function stored by
30
30
/// [markClientToDispose] from the js context
31
31
void disposePreviousClient () {
32
- if (supabaseFlutterWSToClose != null ) {
33
- supabaseFlutterWSToClose ! .callAsFunction ();
34
- supabaseFlutterWSToClose = null ;
32
+ if (supabaseFlutterClientToDispose != null ) {
33
+ supabaseFlutterClientToDispose ! .callAsFunction ();
34
+ supabaseFlutterClientToDispose = null ;
35
35
}
36
36
}
You can’t perform that action at this time.
0 commit comments