diff --git a/uni/lib/model/providers/lazy/bus_stop_provider.dart b/uni/lib/model/providers/lazy/bus_stop_provider.dart index 7beb63a41..aa28e0809 100644 --- a/uni/lib/model/providers/lazy/bus_stop_provider.dart +++ b/uni/lib/model/providers/lazy/bus_stop_provider.dart @@ -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); } diff --git a/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart b/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart index 92d872a3b..9f24bccb4 100644 --- a/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart +++ b/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart @@ -15,6 +15,7 @@ class BusStopSearch extends SearchDelegate { BusStopSearch() { getDatabase(); } + List suggestionsList = []; late final AppBusStopDatabase db; String? stopCode;