Snackbar: Use a private SnackbarDispatcher() to ensure the Snackbar is displayed in the current screen (#4128)

This commit is contained in:
Benoit Marty 2025-01-24 17:28:13 +01:00 committed by Benoit Marty
parent 84eed48b7d
commit 2676dafd1d
2 changed files with 3 additions and 4 deletions

View file

@ -44,7 +44,6 @@ class MediaViewerPresenter @AssistedInject constructor(
@Assisted private val dataSource: MediaViewerDataSource,
private val room: MatrixRoom,
private val localMediaActions: LocalMediaActions,
private val snackbarDispatcher: SnackbarDispatcher,
) : Presenter<MediaViewerState> {
@AssistedFactory
interface Factory {
@ -55,6 +54,9 @@ class MediaViewerPresenter @AssistedInject constructor(
): MediaViewerPresenter
}
// Use a local snackbarDispatcher because this presenter is used in an Overlay Node
private val snackbarDispatcher = SnackbarDispatcher()
@Composable
override fun present(): MediaViewerState {
val coroutineScope = rememberCoroutineScope()