Skip to content

Commit

Permalink
Fix bus stops addition
Browse files Browse the repository at this point in the history
  • Loading branch information
bdmendes committed Jul 30, 2023
1 parent 755ab8c commit 948b16c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions uni/lib/model/providers/lazy/bus_stop_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ class BusStopProvider extends StateProviderNotifier {
updateStatus(RequestStatus.busy);
await fetchUserBusTrips();

if (_configuredBusStops.containsKey(stopCode)) {
(_configuredBusStops[stopCode]!.configuredBuses).clear();
_configuredBusStops[stopCode]!
.configuredBuses
.addAll(stopData.configuredBuses);
} else {
_configuredBusStops[stopCode] = stopData;
}

final db = AppBusStopDatabase();
await db.setBusStops(configuredBusStops);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class BusStopSearch extends SearchDelegate<String> {
BusStopSearch() {
getDatabase();
}

List<String> suggestionsList = [];
late final AppBusStopDatabase db;
String? stopCode;
Expand Down

0 comments on commit 948b16c

Please sign in to comment.