Revert "[TMP] Get widgets / stickers working again"

This reverts commit c47b9ee64d.
This commit is contained in:
SpiritCroc 2023-04-05 11:15:39 +02:00
parent 1e3b77824e
commit 2756877d5b
2 changed files with 1 additions and 12 deletions

View File

@ -291,17 +291,6 @@ 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
* ========================================================================================== */

View File

@ -92,7 +92,7 @@ class WidgetFragment :
if (fragmentArgs.kind.isAdmin()) {
viewModel.getPostAPIMediator().setWebView(views.widgetWebView)
}
viewModel.oldObserveViewEvents {
viewModel.observeViewEvents {
Timber.v("Observed view events: $it")
when (it) {
is WidgetViewEvents.DisplayTerms -> displayTerms(it)