Skip to content

Commit b9daeaf

Browse files
fix: optimize viewFile method in EnvelopeValidation
- Move URL generation outside conditional to avoid code duplication - Ensures URL is generated once and reused for both viewer and fallback - Maintains fallback to window.open() when OCA.Viewer is unavailable Signed-off-by: Vitor Mattos <[email protected]>
1 parent 129aa68 commit b9daeaf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/components/validation/EnvelopeValidation.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ export default {
247247
return n('libresign', '{progress} of {total} document signed', '{progress} of {total} documents signed', total, { progress, total })
248248
},
249249
viewFile(file) {
250+
const fileUrl = generateUrl('/apps/libresign/p/pdf/{uuid}', { uuid: file.uuid })
250251
if (OCA?.Viewer !== undefined) {
251-
const fileUrl = generateUrl('/apps/libresign/p/pdf/{uuid}', { uuid: file.uuid })
252252
const fileInfo = {
253253
source: fileUrl,
254254
basename: file.name,
@@ -260,7 +260,6 @@ export default {
260260
list: [fileInfo],
261261
})
262262
} else {
263-
const fileUrl = generateUrl('/apps/libresign/p/pdf/{uuid}', { uuid: file.uuid })
264263
window.open(`${fileUrl}?_t=${Date.now()}`)
265264
}
266265
},

0 commit comments

Comments
 (0)