From 42d74c656a495a7600aa5e5232ea8ed1c231f524 Mon Sep 17 00:00:00 2001 From: daniyal Date: Wed, 21 Aug 2024 00:43:41 +0500 Subject: [PATCH] fix: in pdf marking if counterpart does not have any of name, displayname, username then show pubkey --- src/components/DrawPDFFields/index.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/DrawPDFFields/index.tsx b/src/components/DrawPDFFields/index.tsx index d0c4b61..a3d43ae 100644 --- a/src/components/DrawPDFFields/index.tsx +++ b/src/components/DrawPDFFields/index.tsx @@ -420,12 +420,10 @@ export const DrawPDFFields = (props: Props) => { {users .filter((u) => u.role === UserRole.signer) .map((user, index) => { - let displayValue = truncate( - hexToNpub(user.pubkey), - { - length: 16 - } - ) + const npub = hexToNpub(user.pubkey) + let displayValue = truncate(npub, { + length: 16 + }) const metadata = props.metadata[user.pubkey] @@ -433,7 +431,8 @@ export const DrawPDFFields = (props: Props) => { displayValue = truncate( metadata.name || metadata.display_name || - metadata.username, + metadata.username || + npub, { length: 16 }