Mavericks 2: replace asyncSubscribe by onAsync

This commit is contained in:
ganfra 2021-10-01 18:11:41 +02:00
parent 96b5d1c96b
commit 43c75bdae7
4 changed files with 5 additions and 5 deletions

View File

@ -138,7 +138,7 @@ class VectorCallActivity : VectorBaseActivity<ActivityCallBinding>(), CallContro
renderState(it)
}
callViewModel.asyncSubscribe(VectorCallViewState::callState) {
callViewModel.onAsync(VectorCallViewState::callState) {
if (it is CallState.Ended) {
handleCallEnded(it)
}

View File

@ -269,7 +269,7 @@ class RoomDetailViewModel @AssistedInject constructor(
copy(activeRoomWidgets = widgets)
}
asyncSubscribe(RoomDetailViewState::activeRoomWidgets) { widgets ->
onAsync(RoomDetailViewState::activeRoomWidgets) { widgets ->
setState {
val jitsiWidget = widgets.firstOrNull { it.type == WidgetType.Jitsi }
val jitsiConfId = jitsiWidget?.let {
@ -1597,7 +1597,7 @@ class RoomDetailViewModel @AssistedInject constructor(
}
private fun observeSummaryState() {
asyncSubscribe(RoomDetailViewState::asyncRoomSummary) { summary ->
onAsync(RoomDetailViewState::asyncRoomSummary) { summary ->
setState {
val typingMessage = typingHelper.getTypingMessage(summary.typingUsers)
copy(

View File

@ -65,7 +65,7 @@ class RoomWidgetsBottomSheet :
views.bottomSheetTitle.textSize = 20f
views.bottomSheetTitle.setTextColor(colorProvider.getColorFromAttribute(R.attr.vctr_content_primary))
epoxyController.listener = this
roomDetailViewModel.asyncSubscribe(RoomDetailViewState::activeRoomWidgets) {
roomDetailViewModel.onAsync(RoomDetailViewState::activeRoomWidgets) {
epoxyController.setData(it)
}
}

View File

@ -101,7 +101,7 @@ class WidgetViewModel @AssistedInject constructor(@Assisted val initialState: Wi
}
private fun subscribeToWidget() {
asyncSubscribe(WidgetViewState::asyncWidget) {
onAsync(WidgetViewState::asyncWidget) {
setState { copy(widgetName = it.name) }
}
}