Prevent user from starting LLS in thread

This commit is contained in:
Benoit Marty 2026-05-11 14:49:53 +02:00
parent e49e183178
commit 7f545079ad
2 changed files with 49 additions and 2 deletions

View file

@ -171,7 +171,7 @@ class ShareLocationPresenter(
dialogState = dialogState,
trackUserLocation = trackUserPosition,
hasLocationPermission = permissionsState.isAnyGranted,
canShareLiveLocation = isLiveLocationSharingEnabled,
canShareLiveLocation = isLiveLocationSharingEnabled && timelineMode.canShareLiveLocation(),
appName = appName,
startLiveLocationAction = startLiveLocationAction.value,
eventSink = ::handleEvent,
@ -210,4 +210,9 @@ class ShareLocationPresenter(
}
}
private fun Timeline.Mode.canShareLiveLocation() = when (this) {
is Timeline.Mode.Thread -> false
else -> true
}
private fun generateBody(uri: String): String = "Location was shared at $uri"