File tree Expand file tree Collapse file tree
powersync_devtools_extension/lib
powersync/lib/src/devtools Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252 flutter-version : " 3.x"
5353 channel : " stable"
5454 - run : dart pub get
55- - run : tool/build- sh
55+ - run : tool/build. sh
5656 name : Build and copy devtools extension
5757 working-directory : packages/powersync_devtools_extension
5858
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ void handleClosed(PowerSyncDatabase database) {
5656 if (enable) {
5757 if (ExposedPowerSyncDatabase .byDatabase[database] case final tracked? ) {
5858 ExposedPowerSyncDatabase .byId.remove (tracked.id);
59+ ExposedPowerSyncDatabase .byDatabase[database] = null ;
5960 }
6061
6162 ExposedPowerSyncDatabase .postChangeEvent ();
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ final selectedDatabase =
9797
9898 if (databases.isEmpty) {
9999 controller.state = null ;
100- } else if (controller.state == null &&
100+ } else if (controller.state == null ||
101101 databases.every ((e) => e.id != controller.state? .ref.id)) {
102102 // Auto-select the first available database once one becomes
103103 // available.
Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ final class RemoteDatabase extends SqliteConnection {
142142 @override
143143 Future <void > close () async {
144144 _updates.close ();
145+ _statusController.close ();
145146 }
146147
147148 @override
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
55import 'package:web/web.dart' as web;
66
77import '../state/databases.dart' ;
8+ import '../state/remote_database.dart' ;
9+ import '../state/service.dart' ;
810
911final class PowerSyncLogo extends StatefulWidget {
1012 const PowerSyncLogo ({super .key});
@@ -89,7 +91,17 @@ final class SelectPowerSyncDatabase extends ConsumerWidget {
8991 for (final database in databases)
9092 DropdownMenuItem (value: database, child: Text (database.name)),
9193 ],
92- onChanged: disabled ? null : (value) {},
94+ onChanged: disabled
95+ ? null
96+ : (value) {
97+ ref.read (selectedDatabase.notifier).state = switch (value) {
98+ null => null ,
99+ final db => RemoteDatabase (
100+ db,
101+ ref.read (serviceProvider).requireValue,
102+ ),
103+ };
104+ },
93105 );
94106 }
95107}
Original file line number Diff line number Diff line change @@ -145,10 +145,11 @@ class _SyncStatus extends ConsumerWidget {
145145 ButtonGroupItemData (
146146 label: 'Open in Diagnostics App' ,
147147 onPressed: () {
148- final url = Uri .http ('localhost:5173' , '/' , {
149- 'token' : credentials.original.token,
150- 'endpoint' : credentials.original.endpoint,
151- });
148+ final url =
149+ Uri .https ('diagnostics-app.powersync.com' , '/' , {
150+ 'token' : credentials.original.token,
151+ 'endpoint' : credentials.original.endpoint,
152+ });
152153 launchUrl (url.toString ());
153154 },
154155 ),
You can’t perform that action at this time.
0 commit comments