Skip to content

Commit 04cb5cc

Browse files
committed
AI feedback
1 parent 5d180a8 commit 04cb5cc

6 files changed

Lines changed: 22 additions & 7 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
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

packages/powersync/lib/src/devtools/devtools.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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();

packages/powersync_devtools_extension/lib/state/databases.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.

packages/powersync_devtools_extension/lib/state/remote_database.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

packages/powersync_devtools_extension/lib/ui/appbar.dart

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
55
import 'package:web/web.dart' as web;
66

77
import '../state/databases.dart';
8+
import '../state/remote_database.dart';
9+
import '../state/service.dart';
810

911
final 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
}

packages/powersync_devtools_extension/lib/ui/overview.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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
),

0 commit comments

Comments
 (0)