Handle remarks from PR #1127
This commit is contained in:
@@ -68,9 +68,9 @@ class ConfirmAccountProviderPresenter @AssistedInject constructor(
|
||||
}
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
launch {
|
||||
defaultOidcActionFlow.collect {
|
||||
onOidcAction(it, loginFlowAction)
|
||||
defaultOidcActionFlow.collect { oidcAction ->
|
||||
if (oidcAction != null) {
|
||||
onOidcAction(oidcAction, loginFlowAction)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,10 +113,9 @@ class ConfirmAccountProviderPresenter @AssistedInject constructor(
|
||||
}
|
||||
|
||||
private suspend fun onOidcAction(
|
||||
oidcAction: OidcAction?,
|
||||
oidcAction: OidcAction,
|
||||
loginFlowAction: MutableState<Async<LoginFlow>>,
|
||||
) {
|
||||
oidcAction ?: return
|
||||
loginFlowAction.value = Async.Loading()
|
||||
when (oidcAction) {
|
||||
OidcAction.GoBack -> {
|
||||
|
||||
@@ -34,7 +34,7 @@ import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
@Composable
|
||||
fun LogoutPreferenceView(
|
||||
state: LogoutPreferenceState,
|
||||
onSuccessLogout: (String?) -> Unit = {}
|
||||
onSuccessLogout: (logoutUrlResult: String?) -> Unit
|
||||
) {
|
||||
val eventSink = state.eventSink
|
||||
if (state.logoutAction is Async.Success) {
|
||||
@@ -96,5 +96,8 @@ internal fun LogoutPreferenceViewDarkPreview() = ElementPreviewDark { ContentToP
|
||||
|
||||
@Composable
|
||||
private fun ContentToPreview() {
|
||||
LogoutPreferenceView(aLogoutPreferenceState())
|
||||
LogoutPreferenceView(
|
||||
aLogoutPreferenceState(),
|
||||
onSuccessLogout = {}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ fun PreferencesRootView(
|
||||
onOpenRageShake: () -> Unit,
|
||||
onOpenAbout: () -> Unit,
|
||||
onOpenDeveloperSettings: () -> Unit,
|
||||
onSuccessLogout: (String?) -> Unit,
|
||||
onSuccessLogout: (logoutUrlResult: String?) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val snackbarHostState = rememberSnackbarHostState(snackbarMessage = state.snackbarMessage)
|
||||
|
||||
@@ -58,7 +58,8 @@ interface MatrixClient : Closeable {
|
||||
|
||||
/**
|
||||
* Logout the user.
|
||||
* Returns an optional URL. When the URL is there, it should be presented to the user after logout for RP initiated logout on their account page.
|
||||
* Returns an optional URL. When the URL is there, it should be presented to the user after logout for
|
||||
* Relying Party (RP) initiated logout on their account page.
|
||||
*/
|
||||
suspend fun logout(): String?
|
||||
suspend fun loadUserDisplayName(): Result<String>
|
||||
|
||||
Reference in New Issue
Block a user