Prevent user from starting LLS in thread
This commit is contained in:
parent
e49e183178
commit
7f545079ad
2 changed files with 49 additions and 2 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue