Skip to content

Commit f137bab

Browse files
committed
fix: avoid id doc approval on signer flow
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 4481d66 commit f137bab

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/store/sign.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,14 @@ export const useSignStore = defineStore('sign', () => {
228228
const buildSignUrl = (signRequestUuid, options = {}) => {
229229
const { documentId } = options
230230
const isApprover = document.value?.settings?.isApprover
231+
const documentUuid = typeof document.value?.uuid === 'string' && document.value.uuid.length > 0
232+
? document.value.uuid
233+
: null
234+
const isApproverFileSigning = isApprover === true
235+
&& typeof signRequestUuid === 'string'
236+
&& signRequestUuid.length > 0
237+
&& documentUuid !== null
238+
&& signRequestUuid === documentUuid
231239

232240
let url
233241
if (signRequestUuid) {
@@ -236,7 +244,7 @@ export const useSignStore = defineStore('sign', () => {
236244
url = generateOcsUrl('/apps/libresign/api/v1/sign/file_id/{id}', { id: documentId }) + '?async=true'
237245
}
238246

239-
if (isApprover) {
247+
if (isApproverFileSigning) {
240248
url += '&idDocApproval=true'
241249
}
242250

0 commit comments

Comments
 (0)