File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/supabase_flutter/lib/src Expand file tree Collapse file tree 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';
33import '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.
1717void 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
3131void disposePreviousClient () {
32- if (supabaseFlutterWSToClose != null ) {
33- supabaseFlutterWSToClose ! .callAsFunction ();
34- supabaseFlutterWSToClose = null ;
32+ if (supabaseFlutterClientToDispose != null ) {
33+ supabaseFlutterClientToDispose ! .callAsFunction ();
34+ supabaseFlutterClientToDispose = null ;
3535 }
3636}
You can’t perform that action at this time.
0 commit comments