Forward error to UI in map screen
This commit is contained in:
parent
31bb9eaac8
commit
fc98057042
@ -1294,7 +1294,7 @@ class TimelineViewModel @AssistedInject constructor(
|
||||
}
|
||||
|
||||
override fun onLocationServiceError(error: Throwable) {
|
||||
_viewEvents.post(RoomDetailViewEvents.Failure(error))
|
||||
_viewEvents.post(RoomDetailViewEvents.Failure(throwable = error, showInDialog = true))
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
|
@ -18,4 +18,6 @@ package im.vector.app.features.location.live.map
|
||||
|
||||
import im.vector.app.core.platform.VectorViewEvents
|
||||
|
||||
sealed interface LocationLiveMapViewEvents : VectorViewEvents
|
||||
sealed interface LocationLiveMapViewEvents : VectorViewEvents {
|
||||
data class Error(val error: Throwable) : LocationLiveMapViewEvents
|
||||
}
|
||||
|
@ -76,6 +76,8 @@ class LocationLiveMapViewFragment @Inject constructor() : VectorBaseFragment<Fra
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
observeViewEvents()
|
||||
|
||||
views.liveLocationBottomSheetRecyclerView.configureWith(bottomSheetController, hasFixedSize = false, disableItemAnimation = true)
|
||||
|
||||
bottomSheetController.callback = object : LiveLocationBottomSheetController.Callback {
|
||||
@ -89,6 +91,14 @@ class LocationLiveMapViewFragment @Inject constructor() : VectorBaseFragment<Fra
|
||||
}
|
||||
}
|
||||
|
||||
private fun observeViewEvents() {
|
||||
viewModel.observeViewEvents { viewEvent ->
|
||||
when(viewEvent) {
|
||||
is LocationLiveMapViewEvents.Error -> displayErrorDialog(viewEvent.error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
setupMap()
|
||||
|
@ -82,6 +82,6 @@ class LocationLiveMapViewModel @AssistedInject constructor(
|
||||
}
|
||||
|
||||
override fun onLocationServiceError(error: Throwable) {
|
||||
// TODO
|
||||
_viewEvents.post(LocationLiveMapViewEvents.Error(error))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user