From ea0f717929c69522a3622a72bea1456ba28dcd72 Mon Sep 17 00:00:00 2001 From: samwel141 Date: Tue, 27 Aug 2024 06:52:27 +0300 Subject: [PATCH] fix: fix button logic in trusts side panel --- .../trustRelationshipSidePanel.js | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/pages/TrustRelationship/trustRelationshipSidePanel.js b/src/pages/TrustRelationship/trustRelationshipSidePanel.js index 6cd1c5a..a4983a2 100644 --- a/src/pages/TrustRelationship/trustRelationshipSidePanel.js +++ b/src/pages/TrustRelationship/trustRelationshipSidePanel.js @@ -130,22 +130,16 @@ function TrustRelationshipSidePanel({ open, onClose, rowInfo }) { - {rowInfo.state === 'requested' && wallet.name === rowInfo.target_wallet && ( - - handleAccept(rowInfo.id)} - > - Accept - - handleDecline(rowInfo.id)}> - Decline - - - )} + {rowInfo.state === 'trusted' && ( + + handleDelete(rowInfo.id)}> + Delete + + + )} - {rowInfo.state === 'requested' && managedWalletsWithDefault.wallets.some(wallet => wallet.name === rowInfo.target_wallet) && ( + {rowInfo.state === 'requested' && ( + managedWalletsWithDefault.wallets.some(wallet => wallet.name === rowInfo.target_wallet) || wallet.name === rowInfo.target_wallet ? ( - )} - - {rowInfo.state === 'trusted' && ( + ) : ( handleDelete(rowInfo.id)}> Delete - )} + ) + )} + + {(rowInfo.state === 'cancelled_by_target' || rowInfo.state === 'cancelled_by_originator') && null} + );