Using orFalse() extension method on nullable boolean

This commit is contained in:
Maxime NATUREL 2022-09-07 17:09:57 +02:00
parent c45f536855
commit 45b138e53d
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import im.vector.app.core.di.ActiveSessionHolder
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emptyFlow import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.map
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo
import org.matrix.android.sdk.api.util.Optional import org.matrix.android.sdk.api.util.Optional
import org.matrix.android.sdk.flow.flow import org.matrix.android.sdk.flow.flow
@ -41,7 +42,7 @@ class GetCurrentSessionCrossSigningInfoUseCase @Inject constructor(
return CurrentSessionCrossSigningInfo( return CurrentSessionCrossSigningInfo(
deviceId = deviceId, deviceId = deviceId,
isCrossSigningInitialized = mxCrossSigningInfo.getOrNull() != null, isCrossSigningInitialized = mxCrossSigningInfo.getOrNull() != null,
isCrossSigningVerified = mxCrossSigningInfo.getOrNull()?.isTrusted() == true isCrossSigningVerified = mxCrossSigningInfo.getOrNull()?.isTrusted().orFalse()
) )
} }
} }