From cd3733e4b4baa0f6e7d8b23331bcc53c1f7c9388 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto Date: Thu, 5 Aug 2021 17:11:51 -0300 Subject: [PATCH 1/3] [FIX] swipe when the user is joined and not when isn't --- app/lib/rocketchat.js | 4 ++++ app/views/RoomsListView/index.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 59ee94fc51b..5d16ab559d7 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -1166,6 +1166,10 @@ const RocketChat = { return !isUnread; }, + isSwipeEnabled(item) { + return !(item?.joinCodeRequired || item?.outside); + }, + isGroupChat(room) { return (room.uids && room.uids.length > 2) || (room.usernames && room.usernames.length > 2); }, diff --git a/app/views/RoomsListView/index.js b/app/views/RoomsListView/index.js index 214f213e42b..42af4c517cd 100644 --- a/app/views/RoomsListView/index.js +++ b/app/views/RoomsListView/index.js @@ -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); @@ -901,6 +903,7 @@ class RoomsListView extends React.Component { width } = this.props; const id = this.getUidDirectMessage(item); + const swipeEnabled = this.isSwipeEnabled(item); return ( ); }; From 434b8978e71f97f6260242a8f132ef58794b0e86 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto Date: Wed, 25 Aug 2021 23:07:15 -0300 Subject: [PATCH 2/3] Added a new conditional to check if is swipeble or not --- app/lib/rocketchat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 5d16ab559d7..4eb6c2daa06 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -1167,7 +1167,7 @@ const RocketChat = { }, isSwipeEnabled(item) { - return !(item?.joinCodeRequired || item?.outside); + return !(item?.search || item?.joinCodeRequired || item?.outside); }, isGroupChat(room) { From 93c09a0accc2030d9c10e1cd0213e667c3405f08 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto Date: Tue, 5 Oct 2021 18:48:49 -0300 Subject: [PATCH 3/3] Minor tweaks --- app/lib/rocketchat.js | 4 ---- app/views/RoomsListView/index.js | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 80d808c0ab5..40722348fac 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -1204,10 +1204,6 @@ const RocketChat = { return !isUnread; }, - isSwipeEnabled(item) { - return !(item?.search || item?.joinCodeRequired || item?.outside); - }, - isGroupChat(room) { return (room.uids && room.uids.length > 2) || (room.usernames && room.usernames.length > 2); }, diff --git a/app/views/RoomsListView/index.js b/app/views/RoomsListView/index.js index a6565aea06b..4149c344b7f 100644 --- a/app/views/RoomsListView/index.js +++ b/app/views/RoomsListView/index.js @@ -591,9 +591,9 @@ class RoomsListView extends React.Component { isRead = item => RocketChat.isRead(item); - isSwipeEnabled = item => RocketChat.isSwipeEnabled(item) + isSwipeEnabled = item => !(item?.search || item?.joinCodeRequired || item?.outside); - getUserPresence = uid => RocketChat.getUserPresence(uid) + getUserPresence = uid => RocketChat.getUserPresence(uid); getUidDirectMessage = room => RocketChat.getUidDirectMessage(room);