[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 <diegolmello@gmail.com>
This commit is contained in:
Reinaldo Neto 2021-10-20 13:34:38 -03:00 committed by GitHub
parent 76a99519ec
commit 1889918875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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 (
<RoomItem
@ -950,6 +953,7 @@ class RoomsListView extends React.Component {
getIsRead={this.isRead}
visitor={item.visitor}
isFocused={currentItem?.rid === item.rid}
swipeEnabled={swipeEnabled}
showAvatar={showAvatar}
displayMode={displayMode}
/>