From 0bb26831ae0acaf88aba0cdf39f1f19491acfef5 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 6 Oct 2020 08:28:06 +0100 Subject: [PATCH 1/2] Hide Jump to Read Receipt button for users who have not yet sent an RR Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/right_panel/UserInfo.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index ecb47e9906..12806766e7 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -369,11 +369,14 @@ const UserOptionsSection: React.FC<{ }); }; - readReceiptButton = ( - - { _t('Jump to read receipt') } - - ); + const room = cli.getRoom(member.roomId); + if (room && room.getEventReadUpTo(member.userId)) { + readReceiptButton = ( + + { _t('Jump to read receipt') } + + ); + } insertPillButton = ( From 2e45374cf8dec139bea00fd3f28d0d76f4f0c049 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 6 Oct 2020 22:49:50 +0100 Subject: [PATCH 2/2] Update src/components/views/right_panel/UserInfo.tsx Co-authored-by: Travis Ralston --- src/components/views/right_panel/UserInfo.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index 12806766e7..807bd27796 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -370,7 +370,7 @@ const UserOptionsSection: React.FC<{ }; const room = cli.getRoom(member.roomId); - if (room && room.getEventReadUpTo(member.userId)) { + if (room?.getEventReadUpTo(member.userId)) { readReceiptButton = ( { _t('Jump to read receipt') }