From 782635ec8ec8532e5fb70db2c24516b75557fdb5 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 12 Dec 2019 23:20:11 +0100 Subject: [PATCH] Keep loading after success --- .../java/im/vector/riotx/features/login/LoginViewState.kt | 3 +++ .../vector/riotx/features/signout/SoftLogoutViewState.kt | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/login/LoginViewState.kt b/vector/src/main/java/im/vector/riotx/features/login/LoginViewState.kt index 13e3d25fe0..b6babfdb0d 100644 --- a/vector/src/main/java/im/vector/riotx/features/login/LoginViewState.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/LoginViewState.kt @@ -49,6 +49,9 @@ data class LoginViewState( || asyncResetPassword is Loading || asyncResetMailConfirmed is Loading || asyncRegistration is Loading + // Keep loading when it is success because of the delay to switch to the next Activity + || asyncLoginAction is Success + } fun isUserLogged(): Boolean { diff --git a/vector/src/main/java/im/vector/riotx/features/signout/SoftLogoutViewState.kt b/vector/src/main/java/im/vector/riotx/features/signout/SoftLogoutViewState.kt index c0c97a1628..9e5a628ec5 100644 --- a/vector/src/main/java/im/vector/riotx/features/signout/SoftLogoutViewState.kt +++ b/vector/src/main/java/im/vector/riotx/features/signout/SoftLogoutViewState.kt @@ -16,10 +16,7 @@ package im.vector.riotx.features.signout -import com.airbnb.mvrx.Async -import com.airbnb.mvrx.Loading -import com.airbnb.mvrx.MvRxState -import com.airbnb.mvrx.Uninitialized +import com.airbnb.mvrx.* import im.vector.riotx.features.login.LoginMode data class SoftLogoutViewState( @@ -35,5 +32,7 @@ data class SoftLogoutViewState( fun isLoading(): Boolean { return asyncLoginAction is Loading + // Keep loading when it is success because of the delay to switch to the next Activity + || asyncLoginAction is Success } }