Keep the child state in AttachmentsPreviewPresenter up to date (#6039)

This makes the `handleEvents` function capture the reference and be able to check the updated state, unblocking the media sending flow
This commit is contained in:
Jorge Martin Espinosa 2026-01-20 10:09:30 +01:00 committed by GitHub
parent 2c6e2c6c89
commit eda0aa87ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -98,7 +98,7 @@ class AttachmentsPreviewPresenter(
val mediaOptimizationSelectorPresenter = remember {
mediaOptimizationSelectorPresenterFactory.create(mediaAttachment.localMedia)
}
val mediaOptimizationSelectorState = mediaOptimizationSelectorPresenter.present()
val mediaOptimizationSelectorState by rememberUpdatedState(mediaOptimizationSelectorPresenter.present())
val observableSendState = snapshotFlow { sendActionState.value }