An error was displayed by mistake

This commit is contained in:
Benoit Marty 2019-08-19 17:22:04 +02:00
parent e7819ce678
commit 8ca829d538

View File

@ -18,6 +18,7 @@ package im.vector.riotx.features.roomdirectory.roompreview

import android.os.Bundle
import android.view.View
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.transition.TransitionManager
import com.airbnb.mvrx.args
@ -104,7 +105,12 @@ class RoomPreviewNoPreviewFragment : VectorBaseFragment() {
}
)

roomPreviewNoPreviewError.setTextOrHide(errorFormatter.toHumanReadable(state.lastError))
if (state.lastError == null) {
roomPreviewNoPreviewError.isVisible = false
} else {
roomPreviewNoPreviewError.isVisible = true
roomPreviewNoPreviewError.text = errorFormatter.toHumanReadable(state.lastError)
}

if (state.roomJoinState == JoinState.JOINED) {
// Quit this screen