allow signing and show PdfView without any marks (never created) #287

Merged
b merged 4 commits from 286-missing-pdf-and-sign into staging 2025-01-02 09:43:46 +00:00
Showing only changes of commit cb0d2dd7bc - Show all commits

View File

@ -101,8 +101,7 @@ const PdfMarking = (props: PdfMarkingProps) => {
*/ */
const handleSubmit = (event: React.MouseEvent<HTMLButtonElement>) => { const handleSubmit = (event: React.MouseEvent<HTMLButtonElement>) => {
event.preventDefault() event.preventDefault()
if (!selectedMarkValue || !selectedMark) return if (selectedMarkValue && selectedMark) {
const updatedMark: CurrentUserMark = getUpdatedMark( const updatedMark: CurrentUserMark = getUpdatedMark(
selectedMark, selectedMark,
selectedMarkValue selectedMarkValue
@ -116,6 +115,8 @@ const PdfMarking = (props: PdfMarkingProps) => {
setCurrentUserMarks(updatedCurrentUserMarks) setCurrentUserMarks(updatedCurrentUserMarks)
setSelectedMark(null) setSelectedMark(null)
setUpdatedMarks(updatedMark.mark) setUpdatedMarks(updatedMark.mark)
}
handleSign() handleSign()
} }
@ -162,7 +163,6 @@ const PdfMarking = (props: PdfMarkingProps) => {
otherUserMarks={otherUserMarks} otherUserMarks={otherUserMarks}
/> />
</StickySideColumns> </StickySideColumns>
{selectedMark !== null && (
<MarkFormField <MarkFormField
handleSubmit={handleSubmit} handleSubmit={handleSubmit}
handleSelectedMarkValueChange={handleChange} handleSelectedMarkValueChange={handleChange}
@ -171,7 +171,6 @@ const PdfMarking = (props: PdfMarkingProps) => {
currentUserMarks={currentUserMarks} currentUserMarks={currentUserMarks}
handleCurrentUserMarkChange={handleCurrentUserMarkChange} handleCurrentUserMarkChange={handleCurrentUserMarkChange}
/> />
)}
</Container> </Container>
</> </>
) )