Upgrade SDK version to 25.02.26 (#4305)
* Upgrade SDK version to 25.02.26 * Remove OIDC URL result from logout, the SDK no longer provides it * Handle room creation and destruction in a better way * Remove `onSuccessLogout`
This commit is contained in:
committed by
GitHub
parent
3c30bec1c2
commit
274d9dc7c1
@@ -14,10 +14,8 @@ interface LogoutUseCase {
|
||||
/**
|
||||
* Log out the current user and then perform any needed cleanup tasks.
|
||||
* @param ignoreSdkError if true, the SDK error will be ignored and the user will be logged out anyway.
|
||||
* @return 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(ignoreSdkError: Boolean): String?
|
||||
suspend fun logout(ignoreSdkError: Boolean)
|
||||
|
||||
interface Factory {
|
||||
fun create(sessionId: String): LogoutUseCase
|
||||
|
||||
@@ -11,6 +11,6 @@ import io.element.android.libraries.architecture.AsyncAction
|
||||
|
||||
data class DirectLogoutState(
|
||||
val canDoDirectSignOut: Boolean,
|
||||
val logoutAction: AsyncAction<String?>,
|
||||
val logoutAction: AsyncAction<Unit>,
|
||||
val eventSink: (DirectLogoutEvents) -> Unit,
|
||||
)
|
||||
|
||||
@@ -17,13 +17,13 @@ open class DirectLogoutStateProvider : PreviewParameterProvider<DirectLogoutStat
|
||||
aDirectLogoutState(logoutAction = AsyncAction.ConfirmingNoParams),
|
||||
aDirectLogoutState(logoutAction = AsyncAction.Loading),
|
||||
aDirectLogoutState(logoutAction = AsyncAction.Failure(Exception("Error"))),
|
||||
aDirectLogoutState(logoutAction = AsyncAction.Success("success")),
|
||||
aDirectLogoutState(logoutAction = AsyncAction.Success(Unit)),
|
||||
)
|
||||
}
|
||||
|
||||
fun aDirectLogoutState(
|
||||
canDoDirectSignOut: Boolean = true,
|
||||
logoutAction: AsyncAction<String?> = AsyncAction.Uninitialized,
|
||||
logoutAction: AsyncAction<Unit> = AsyncAction.Uninitialized,
|
||||
eventSink: (DirectLogoutEvents) -> Unit = {},
|
||||
) = DirectLogoutState(
|
||||
canDoDirectSignOut = canDoDirectSignOut,
|
||||
|
||||
@@ -11,8 +11,5 @@ import androidx.compose.runtime.Composable
|
||||
|
||||
interface DirectLogoutView {
|
||||
@Composable
|
||||
fun Render(
|
||||
state: DirectLogoutState,
|
||||
onSuccessLogout: (logoutUrlResult: String?) -> Unit
|
||||
)
|
||||
fun Render(state: DirectLogoutState)
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright 2024 New Vector Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.features.logout.api.util
|
||||
|
||||
import android.app.Activity
|
||||
import io.element.android.libraries.androidutils.browser.openUrlInChromeCustomTab
|
||||
import timber.log.Timber
|
||||
|
||||
fun onSuccessLogout(
|
||||
activity: Activity,
|
||||
darkTheme: Boolean,
|
||||
url: String?,
|
||||
) {
|
||||
Timber.d("Success logout with result url: $url")
|
||||
url?.let {
|
||||
activity.openUrlInChromeCustomTab(null, darkTheme, it)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user