[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:
parent
76a99519ec
commit
1889918875
|
@ -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}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue