Skip to content

Commit fdc44df

Browse files
committed
ignore late reqs
1 parent aa00d9b commit fdc44df

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

location/src/main/kotlin/io/customer/location/LocationServicesImpl.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ internal class LocationServicesImpl(
4242
}
4343

4444
override fun requestLocationUpdate() {
45-
// Cancel any previous in-flight request to avoid concurrent GPS calls
46-
currentLocationJob?.cancel()
45+
// If a request is already in flight, ignore the new call
46+
if (currentLocationJob?.isActive == true) return
47+
4748
currentLocationJob = scope.launch {
4849
try {
4950
orchestrator.requestLocationUpdate()

0 commit comments

Comments
 (0)