Don't crash when sharing a location with no maptiler apikey (#919)

Related to:
- https://github.com/vector-im/element-meta/issues/1682
This commit is contained in:
Marco Romano 2023-07-19 16:33:50 +02:00 committed by GitHub
parent 8b97d50050
commit cec87ee6a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,7 +133,10 @@ fun SendLocationView(
)
)
},
modifier = Modifier.clickable {
modifier = Modifier.clickable(
// target is null when the map hasn't loaded (or api key is wrong) so we disable the button
enabled = cameraPositionState.position.target != null
) {
state.eventSink(
SendLocationEvents.SendLocation(
cameraPosition = SendLocationEvents.SendLocation.CameraPosition(