From 188991887536b67f24bd38603b788d7f1ebc3ec3 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Wed, 20 Oct 2021 13:34:38 -0300 Subject: [PATCH] [FIX] Disable swipe when room is not joined (#3319) * [FIX] swipe when the user is joined and not when isn't * Added a new conditional to check if is swipeble or not * Minor tweaks Co-authored-by: Diego Mello --- app/views/RoomsListView/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/RoomsListView/index.js b/app/views/RoomsListView/index.js index 41da6dd80..518e10c48 100644 --- a/app/views/RoomsListView/index.js +++ b/app/views/RoomsListView/index.js @@ -613,6 +613,8 @@ class RoomsListView extends React.Component { isRead = item => RocketChat.isRead(item); + isSwipeEnabled = item => !(item?.search || item?.joinCodeRequired || item?.outside); + getUserPresence = uid => RocketChat.getUserPresence(uid); getUidDirectMessage = room => RocketChat.getUidDirectMessage(room); @@ -928,6 +930,7 @@ class RoomsListView extends React.Component { displayMode } = this.props; const id = this.getUidDirectMessage(item); + const swipeEnabled = this.isSwipeEnabled(item); return (