Skip to content
4 changes: 4 additions & 0 deletions app/lib/rocketchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,10 @@ const RocketChat = {
return !isUnread;
},

isSwipeEnabled(item) {
Comment thread
reinaldonetof marked this conversation as resolved.
Outdated
return !(item?.joinCodeRequired || item?.outside);
},

isGroupChat(room) {
return (room.uids && room.uids.length > 2) || (room.usernames && room.usernames.length > 2);
},
Expand Down
4 changes: 4 additions & 0 deletions app/views/RoomsListView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ class RoomsListView extends React.Component {

isRead = item => RocketChat.isRead(item)

isSwipeEnabled = item => RocketChat.isSwipeEnabled(item)

getUserPresence = uid => RocketChat.getUserPresence(uid)

getUidDirectMessage = room => RocketChat.getUidDirectMessage(room);
Expand Down Expand Up @@ -901,6 +903,7 @@ class RoomsListView extends React.Component {
width
} = this.props;
const id = this.getUidDirectMessage(item);
const swipeEnabled = this.isSwipeEnabled(item);

return (
<RoomItem
Expand All @@ -923,6 +926,7 @@ class RoomsListView extends React.Component {
getIsRead={this.isRead}
visitor={item.visitor}
isFocused={currentItem?.rid === item.rid}
swipeEnabled={swipeEnabled}
/>
);
};
Expand Down