Skip to content

Display the "verification success" Snackbar only when the state is VerificationFlowState.Finished. #811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import io.element.android.libraries.matrix.api.verification.VerificationFlowStat
import io.element.android.libraries.ui.strings.CommonStrings
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.drop
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onEach
Expand All @@ -47,12 +47,15 @@ class LoggedInEventProcessor @Inject constructor(

fun observeEvents(coroutineScope: CoroutineScope) {
observingJob = coroutineScope.launch {
displayLeftRoomMessage.onEach {
displayMessage(CommonStrings.common_current_user_left_room)
}.launchIn(this)
displayLeftRoomMessage
.filter { it }
.onEach {
displayMessage(CommonStrings.common_current_user_left_room)
}
.launchIn(this)

displayVerificationSuccessfulMessage
.drop(1)
.filter { it }
.onEach {
displayMessage(CommonStrings.common_verification_complete)
}.launchIn(this)
Expand Down