From 8ca829d538050f0965f7c97a51fd04e0743f8407 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 19 Aug 2019 17:22:04 +0200 Subject: [PATCH] An error was displayed by mistake --- .../roompreview/RoomPreviewNoPreviewFragment.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/riotx/features/roomdirectory/roompreview/RoomPreviewNoPreviewFragment.kt b/vector/src/main/java/im/vector/riotx/features/roomdirectory/roompreview/RoomPreviewNoPreviewFragment.kt index c0da697a95..b8b81006e0 100644 --- a/vector/src/main/java/im/vector/riotx/features/roomdirectory/roompreview/RoomPreviewNoPreviewFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/roomdirectory/roompreview/RoomPreviewNoPreviewFragment.kt @@ -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