[TMP] Get widgets / stickers working again
Change-Id: If24a0b93dc1d689ee68315ba068f0711c43979df
This commit is contained in:
parent
e02a3adcdf
commit
c47b9ee64d
|
@ -291,6 +291,17 @@ abstract class VectorBaseFragment<VB : ViewBinding> : Fragment(), MavericksView
|
|||
}
|
||||
}
|
||||
|
||||
// SC-TODO: this is the pre-v1.5.18 implementation of observeViewEvents, to fix custom widgets. Revert me once upstream implements a fix.
|
||||
protected fun <T : VectorViewEvents> VectorViewModel<*, *, T>.oldObserveViewEvents(observer: (T) -> Unit) {
|
||||
val tag = this@VectorBaseFragment::class.simpleName.toString()
|
||||
viewEvents
|
||||
.stream(tag)
|
||||
.onEach {
|
||||
observer(it)
|
||||
}
|
||||
.launchIn(viewLifecycleOwner.lifecycleScope)
|
||||
}
|
||||
|
||||
/* ==========================================================================================
|
||||
* Views
|
||||
* ========================================================================================== */
|
||||
|
|
|
@ -92,7 +92,7 @@ class WidgetFragment :
|
|||
if (fragmentArgs.kind.isAdmin()) {
|
||||
viewModel.getPostAPIMediator().setWebView(views.widgetWebView)
|
||||
}
|
||||
viewModel.observeViewEvents {
|
||||
viewModel.oldObserveViewEvents {
|
||||
Timber.v("Observed view events: $it")
|
||||
when (it) {
|
||||
is WidgetViewEvents.DisplayTerms -> displayTerms(it)
|
||||
|
|
Loading…
Reference in New Issue