File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
lib-compose/src/main/java/com/what3words/components/compose/maps/buttons Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -119,14 +119,22 @@ internal fun MyLocationButton(
119119 }
120120
121121 LaunchedEffect (locationStatus) {
122- if (locationStatus == LocationStatus .SEARCHING ) {
123- while (true ) {
124- // Switch searching icon
125- searchingIconState = SearchIconState .ICON_ONE
126- delay(400L )
127- searchingIconState = SearchIconState .ICON_TWO
128- delay(800L )
122+ when (locationStatus) {
123+ LocationStatus .SEARCHING -> {
124+ while (true ) {
125+ // Switch searching icon
126+ searchingIconState = SearchIconState .ICON_ONE
127+ delay(400L )
128+ searchingIconState = SearchIconState .ICON_TWO
129+ delay(800L )
130+ }
131+ }
132+
133+ LocationStatus .INACTIVE -> {
134+ isShowingAccuracy = false
129135 }
136+
137+ else -> {}
130138 }
131139 }
132140
@@ -209,7 +217,7 @@ internal fun MyLocationButton(
209217 modifier = Modifier .size(layoutConfig.locationIconSize)
210218 )
211219 }
212- if (accuracyDistanceInMeter >= SAFE_ACCURACY_DISTANCE ) {
220+ if (accuracyDistanceInMeter >= SAFE_ACCURACY_DISTANCE && locationStatus != LocationStatus . INACTIVE ) {
213221 WarningIndicator (
214222 modifier = Modifier .align(Alignment .TopEnd ),
215223 accuracyDistance = accuracyDistanceInMeter,
You can’t perform that action at this time.
0 commit comments