fix: only append link with page attribute if metatada.page is available

This commit is contained in:
Jannik S. 2024-09-23 23:43:50 +02:00 committed by GitHub
parent 8eb82265d0
commit f69956bda8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@
<a
class="hover:text-gray-500 hover:dark:text-gray-100 underline"
href={document?.metadata?.file_id
? `/api/v1/files/${document?.metadata?.file_id}/content#page=${document?.metadata?.page + 1}`
? `/api/v1/files/${document?.metadata?.file_id}/content${document?.metadata?.page !== undefined ? `#page=${document.metadata.page + 1}` : ''}`
: document.source.name.includes('http')
? document.source.name
: `#`}