From 0766ec456ce1a9bc53de3ca4d078e57d92256eb0 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 24 Apr 2023 15:08:56 +0200 Subject: [PATCH] Oidc custom tab: avoid replay. --- .../login/impl/oidc/customtab/DefaultOidcActionFlow.kt | 4 ++++ .../android/features/login/impl/root/LoginRootPresenter.kt | 1 + 2 files changed, 5 insertions(+) diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/oidc/customtab/DefaultOidcActionFlow.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/oidc/customtab/DefaultOidcActionFlow.kt index 87c22629a0..41ec484298 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/oidc/customtab/DefaultOidcActionFlow.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/oidc/customtab/DefaultOidcActionFlow.kt @@ -36,4 +36,8 @@ class DefaultOidcActionFlow @Inject constructor() : OidcActionFlow { suspend fun collect(lambda: suspend (OidcAction?) -> Unit) { mutableStateFlow.collect(lambda) } + + fun reset() { + mutableStateFlow.value = null + } } diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/root/LoginRootPresenter.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/root/LoginRootPresenter.kt index ecf6533929..f55c2030e7 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/root/LoginRootPresenter.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/root/LoginRootPresenter.kt @@ -166,5 +166,6 @@ class LoginRootPresenter @Inject constructor( } } } + defaultOidcActionFlow.reset() } }