fix(marks): add default signer #207
@ -39,6 +39,7 @@ export const DrawPDFFields = (props: Props) => {
|
|||||||
const { selectedFiles, selectedTool, onDrawFieldsChange, users } = props
|
const { selectedFiles, selectedTool, onDrawFieldsChange, users } = props
|
||||||
const signers = users.filter((u) => u.role === UserRole.signer)
|
const signers = users.filter((u) => u.role === UserRole.signer)
|
||||||
const defaultSignerNpub = signers.length ? hexToNpub(signers[0].pubkey) : ''
|
const defaultSignerNpub = signers.length ? hexToNpub(signers[0].pubkey) : ''
|
||||||
|
const [lastSigner, setLastSigner] = useState(defaultSignerNpub)
|
||||||
const { to, from } = useScale()
|
const { to, from } = useScale()
|
||||||
|
|
||||||
const [sigitFiles, setSigitFiles] = useState<SigitFile[]>([])
|
const [sigitFiles, setSigitFiles] = useState<SigitFile[]>([])
|
||||||
@ -117,7 +118,7 @@ export const DrawPDFFields = (props: Props) => {
|
|||||||
top: to(page.width, y),
|
top: to(page.width, y),
|
||||||
width: event.pointerType === 'mouse' ? 0 : DEFAULT_START_SIZE.width,
|
width: event.pointerType === 'mouse' ? 0 : DEFAULT_START_SIZE.width,
|
||||||
height: event.pointerType === 'mouse' ? 0 : DEFAULT_START_SIZE.height,
|
height: event.pointerType === 'mouse' ? 0 : DEFAULT_START_SIZE.height,
|
||||||
counterpart: defaultSignerNpub,
|
counterpart: lastSigner,
|
||||||
type: selectedTool.identifier
|
type: selectedTool.identifier
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -456,10 +457,14 @@ export const DrawPDFFields = (props: Props) => {
|
|||||||
<InputLabel id="counterparts">Counterpart</InputLabel>
|
<InputLabel id="counterparts">Counterpart</InputLabel>
|
||||||
<Select
|
<Select
|
||||||
value={
|
value={
|
||||||
drawnField.counterpart || defaultSignerNpub || ''
|
drawnField.counterpart ||
|
||||||
|
lastSigner ||
|
||||||
|
defaultSignerNpub ||
|
||||||
|
''
|
||||||
}
|
}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
drawnField.counterpart = event.target.value
|
drawnField.counterpart = event.target.value
|
||||||
|
setLastSigner(event.target.value)
|
||||||
refreshPdfFiles()
|
refreshPdfFiles()
|
||||||
}}
|
}}
|
||||||
labelId="counterparts"
|
labelId="counterparts"
|
||||||
|
Loading…
Reference in New Issue
Block a user