mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
Fix minor warning.
This commit is contained in:
committed by
Benoit Marty
parent
1ecb704e24
commit
1f15573fef
+2
-2
@@ -54,7 +54,7 @@ class SnackbarDispatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Used to provide a [SnackbarDispatcher] to composable functions, it's needed for [rememberSnackbarHostState]. */
|
/** Used to provide a [SnackbarDispatcher] to composable functions, it's needed for [rememberSnackbarHostState]. */
|
||||||
val LocalSnackbarDispatcher = compositionLocalOf<SnackbarDispatcher> { SnackbarDispatcher() }
|
val LocalSnackbarDispatcher = compositionLocalOf { SnackbarDispatcher() }
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SnackbarDispatcher.collectSnackbarMessageAsState(): State<SnackbarMessage?> {
|
fun SnackbarDispatcher.collectSnackbarMessageAsState(): State<SnackbarMessage?> {
|
||||||
@@ -75,7 +75,7 @@ fun rememberSnackbarHostState(snackbarMessage: SnackbarMessage?): SnackbarHostSt
|
|||||||
LaunchedEffect(snackbarMessage.id) {
|
LaunchedEffect(snackbarMessage.id) {
|
||||||
// If the message wasn't already displayed, do it now, and mark it as displayed
|
// If the message wasn't already displayed, do it now, and mark it as displayed
|
||||||
// This will prevent the message from appearing in any other active SnackbarHosts
|
// This will prevent the message from appearing in any other active SnackbarHosts
|
||||||
if (snackbarMessage.isDisplayed.getAndSet(true) == false) {
|
if (snackbarMessage.isDisplayed.getAndSet(true).not()) {
|
||||||
try {
|
try {
|
||||||
snackbarHostState.showSnackbar(
|
snackbarHostState.showSnackbar(
|
||||||
message = snackbarMessageText,
|
message = snackbarMessageText,
|
||||||
|
|||||||
Reference in New Issue
Block a user