fix gps updated

This commit is contained in:
2023-11-27 13:22:18 +05:30
parent 9c66dffe69
commit 13e07b007a
2 changed files with 7 additions and 2 deletions

View File

@ -37,6 +37,8 @@ class DestinationController extends GetxController {
double currentLat = 0.0;
double currentLon = 0.0;
bool gps_push_started = false;
bool skip_10s = false;
List<Destination> currentSelectedDestinations = <Destination>[].obs;
@ -571,7 +573,9 @@ class DestinationController extends GetxController {
break;
}
}
pushGPStoServer();
if (gps_push_started == false) {
pushGPStoServer();
}
//print("--- 123 ---- $skip_gps----");
} catch (e) {
//print("An error occurred: $e");
@ -585,6 +589,7 @@ class DestinationController extends GetxController {
Future<void> pushGPStoServer() async {
try {
await Future.delayed(const Duration(minutes: 5));
gps_push_started = true;
ExternalService().pushGPS();
} catch (e) {
//print("An error occurred: $e");