mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-09-23 17:50:42 +02:00
Fix branch after android testing. Add background data refresh, not just location refresh.
Tested on a Pixel 10 Pro. These changes were needed to work on real hardware. Also, which background location updating was working, the data was not refreshing in the background. This also adds that. It will pull nodes in a 5km area around your location and update when you within 1km of the area. These values may need to be adjusted if there is increased load on the servers.
This commit is contained in:
@@ -217,6 +217,16 @@ class MapViewState extends State<MapView> with WidgetsBindingObserver {
|
||||
}
|
||||
return [];
|
||||
},
|
||||
onFetchBackgroundNodes: (bounds) async {
|
||||
if (!mounted) return;
|
||||
final appState = context.read<AppState>();
|
||||
|
||||
NodeProviderWithCache.instance.fetchAndUpdate(
|
||||
bounds: bounds,
|
||||
profiles: appState.enabledProfiles,
|
||||
uploadMode: appState.uploadMode,
|
||||
);
|
||||
},
|
||||
onMapMovedProgrammatically: () {
|
||||
// Refresh nodes when GPS controller moves the map
|
||||
_refreshNodesFromProvider();
|
||||
|
||||
Reference in New Issue
Block a user