Skip to content

Commit a070b9f

Browse files
authored
fix: Hide 'View Private Key' when Neuron connects to a hardware wallet (nervosnetwork#3317)
1 parent 03a35df commit a070b9f

File tree

1 file changed

+7
-4
lines changed
  • packages/neuron-ui/src/components/Receive

1 file changed

+7
-4
lines changed

packages/neuron-ui/src/components/Receive/index.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const AddressQrCodeWithCopyZone = ({
2525
onClick,
2626
}: AddressTransformWithCopyZoneProps) => {
2727
const [t] = useTranslation()
28+
const { wallet } = useGlobalState()
2829
const transformLabel = t(
2930
isInShortFormat ? 'receive.turn-into-full-version-format' : 'receive.turn-into-deprecated-format'
3031
)
@@ -85,10 +86,12 @@ export const AddressQrCodeWithCopyZone = ({
8586
<AddressTransform />
8687
{transformLabel}
8788
</button>
88-
<button type="button" className={styles.privateKey} onClick={() => setShowViewPrivateKey(true)}>
89-
<PrivateKey />
90-
{t('addresses.view-private-key')}
91-
</button>
89+
{!wallet.device && (
90+
<button type="button" className={styles.privateKey} onClick={() => setShowViewPrivateKey(true)}>
91+
<PrivateKey />
92+
{t('addresses.view-private-key')}
93+
</button>
94+
)}
9295
</div>
9396
</div>
9497

0 commit comments

Comments
 (0)