From 923a47b4d086563fc1f514b962cfdecb281d6b87 Mon Sep 17 00:00:00 2001 From: enes Date: Tue, 27 Aug 2024 16:10:57 +0200 Subject: [PATCH] fix(drawfield): match label and select --- src/components/DrawPDFFields/index.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/DrawPDFFields/index.tsx b/src/components/DrawPDFFields/index.tsx index b808c40..66f6952 100644 --- a/src/components/DrawPDFFields/index.tsx +++ b/src/components/DrawPDFFields/index.tsx @@ -428,9 +428,7 @@ export const DrawPDFFields = (props: Props) => { sx={{ background: 'white' }} - renderValue={(value) => - renderCounterpartValue(drawnField, value) - } + renderValue={(value) => renderCounterpartValue(value)} > {users .filter((u) => u.role === UserRole.signer) @@ -491,14 +489,14 @@ export const DrawPDFFields = (props: Props) => { ) } - const renderCounterpartValue = (drawnField: DrawnField, value: string) => { + const renderCounterpartValue = (value: string) => { const user = users.find((u) => u.pubkey === npubToHex(value)) if (user) { let displayValue = truncate(value, { length: 16 }) - const metadata = props.metadata[value] + const metadata = props.metadata[user.pubkey] if (metadata) { displayValue = truncate( @@ -511,8 +509,8 @@ export const DrawPDFFields = (props: Props) => { return ( <>