[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);
|
isRead = item => RocketChat.isRead(item);
|
||||||
|
|
||||||
|
isSwipeEnabled = item => !(item?.search || item?.joinCodeRequired || item?.outside);
|
||||||
|
|
||||||
getUserPresence = uid => RocketChat.getUserPresence(uid);
|
getUserPresence = uid => RocketChat.getUserPresence(uid);
|
||||||
|
|
||||||
getUidDirectMessage = room => RocketChat.getUidDirectMessage(room);
|
getUidDirectMessage = room => RocketChat.getUidDirectMessage(room);
|
||||||
|
@ -928,6 +930,7 @@ class RoomsListView extends React.Component {
|
||||||
displayMode
|
displayMode
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const id = this.getUidDirectMessage(item);
|
const id = this.getUidDirectMessage(item);
|
||||||
|
const swipeEnabled = this.isSwipeEnabled(item);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RoomItem
|
<RoomItem
|
||||||
|
@ -950,6 +953,7 @@ class RoomsListView extends React.Component {
|
||||||
getIsRead={this.isRead}
|
getIsRead={this.isRead}
|
||||||
visitor={item.visitor}
|
visitor={item.visitor}
|
||||||
isFocused={currentItem?.rid === item.rid}
|
isFocused={currentItem?.rid === item.rid}
|
||||||
|
swipeEnabled={swipeEnabled}
|
||||||
showAvatar={showAvatar}
|
showAvatar={showAvatar}
|
||||||
displayMode={displayMode}
|
displayMode={displayMode}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue