Rename widget action.

This commit is contained in:
Onuray Sahin 2022-07-22 14:36:02 +03:00
parent 242c14a156
commit 23a25cf240
3 changed files with 4 additions and 4 deletions

View file

@ -26,5 +26,5 @@ sealed class WidgetAction : VectorViewModelAction {
object DeleteWidget : WidgetAction()
object RevokeWidget : WidgetAction()
object OnTermsReviewed : WidgetAction()
object HangupElementCall : WidgetAction()
object CloseWidget : WidgetAction()
}

View file

@ -189,7 +189,7 @@ class WidgetActivity : VectorBaseActivity<ActivityWidgetBinding>() {
if (intent?.action == ACTION_MEDIA_CONTROL) {
val controlType = intent.getIntExtra(EXTRA_CONTROL_TYPE, 0)
if (controlType == CONTROL_TYPE_HANGUP) {
viewModel.handle(WidgetAction.HangupElementCall)
viewModel.handle(WidgetAction.CloseWidget)
}
}
}

View file

@ -147,11 +147,11 @@ class WidgetViewModel @AssistedInject constructor(
WidgetAction.DeleteWidget -> handleDeleteWidget()
WidgetAction.RevokeWidget -> handleRevokeWidget()
WidgetAction.OnTermsReviewed -> loadFormattedUrl(forceFetchToken = false)
WidgetAction.HangupElementCall -> handleHangupElementCall()
WidgetAction.CloseWidget -> handleCloseWidget()
}
}
private fun handleHangupElementCall() {
private fun handleCloseWidget() {
_viewEvents.post(WidgetViewEvents.Close())
}