mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Prevent user from starting LLS in thread
This commit is contained in:
+6
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user