fix: #201, #145, #205 and additional fixes #206

Merged
enes merged 14 commits from 201-toolbox-update into staging 2024-09-30 14:20:07 +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 { 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"