fix(marks): add default signer #207

Merged
enes merged 3 commits from 145-default-signer into 201-toolbox-update 2024-09-19 11:24:17 +00:00
Showing only changes of commit 39934f59c3 - Show all commits

View File

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