Always use the latest... fix.
This commit is contained in:
parent
3ced570b3c
commit
eb51b49aef
9 changed files with 49 additions and 19 deletions
|
|
@ -18,6 +18,8 @@ package io.element.android.features.logout.impl.ui
|
|||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.rememberUpdatedState
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import io.element.android.features.logout.impl.R
|
||||
import io.element.android.libraries.architecture.AsyncAction
|
||||
|
|
@ -52,9 +54,11 @@ fun LogoutActionDialog(
|
|||
onRetry = onForceLogoutClicked,
|
||||
onDismiss = onDismissError,
|
||||
)
|
||||
is AsyncAction.Success ->
|
||||
LaunchedEffect(state, onSuccessLogout) {
|
||||
onSuccessLogout(state.data)
|
||||
is AsyncAction.Success -> {
|
||||
val latestOnSuccessLogout by rememberUpdatedState(onSuccessLogout)
|
||||
LaunchedEffect(state) {
|
||||
latestOnSuccessLogout(state.data)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue