Skip to content

Commit

Permalink
Improve performance and avoid circumvention of auto-connect filter by…
Browse files Browse the repository at this point in the history
… system scooters
  • Loading branch information
TheFreal committed Nov 8, 2024
1 parent 4a72d30 commit 9d96f8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ class _HomeScreenState extends State<HomeScreen> {
void redirectOrStart() async {
List<String> ids = await widget.scooterService.getSavedScooterIds();
log.info("Saved scooters: $ids");
if ((await widget.scooterService.getSavedScooterIds()).isEmpty) {
if (ids.isEmpty) {
FlutterNativeSplash.remove();
Navigator.pushReplacement(
context,
Expand Down
5 changes: 2 additions & 3 deletions lib/scooter_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,8 @@ class ScooterService {
List<String> savedScooterIds =
await getSavedScooterIds(onlyAutoConnect: true);
for (var device in systemDevices) {
// criteria: it's named "unu Scooter" or it's one we saved
if (device.advName == "unu Scooter" ||
savedScooterIds.contains(device.remoteId.toString())) {
// see if this is a scooter we saved and want to (auto-)connect to
if (savedScooterIds.contains(device.remoteId.toString())) {
// That's a scooter!
systemScooters.add(device);
}
Expand Down

0 comments on commit 9d96f8c

Please sign in to comment.