diff --git a/back/database/index.js b/back/database/index.js index 4df4346..67b90b0 100644 --- a/back/database/index.js +++ b/back/database/index.js @@ -944,8 +944,12 @@ async function getPastBusArrival(routeId, stationId, staOrder, date, onlySevenDa if (busArrivalList && busArrivalList.length > 0) { const mappedData = applySpecialRouteMapping(busArrivalList, stationId, routeId); - cache[cacheKey] = mappedData; - allResults = allResults.concat(mappedData); + const dataWithOffset = mappedData.map(item => ({ + ...item, + daysAgo: Math.abs(dayOffset) + })); + cache[cacheKey] = dataWithOffset; + allResults = allResults.concat(dataWithOffset); } } diff --git a/front/lib/station_bus_info_page.dart b/front/lib/station_bus_info_page.dart index c7e13e3..8fdbeae 100644 --- a/front/lib/station_bus_info_page.dart +++ b/front/lib/station_bus_info_page.dart @@ -38,7 +38,7 @@ class _StationBusInfoPageState extends State { void initState() { super.initState(); fetchBusData(); - _timer = Timer.periodic(const Duration(seconds: 15), (timer) { + _timer = Timer.periodic(const Duration(seconds: 30), (timer) { fetchBusData(); }); } diff --git a/front/lib/station_bus_list_page.dart b/front/lib/station_bus_list_page.dart index 89fa258..8edd9d1 100644 --- a/front/lib/station_bus_list_page.dart +++ b/front/lib/station_bus_list_page.dart @@ -149,7 +149,7 @@ class _StationBusListPageState extends State { const Divider(height: 1), Expanded( child: ListView.separated( - //controller: _scrollController, + controller: _scrollController, padding: EdgeInsets.zero, itemCount: timeBasedData.length, separatorBuilder: (context, index) => const Divider(height: 1),