Fix large asset preview [SCI-8433] (#5408)

This commit is contained in:
ajugo 2023-05-16 10:24:08 +02:00 committed by GitHub
parent 57d736cbe4
commit d8945cc627
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -51,7 +51,7 @@
</a> </a>
</div> </div>
</template> </template>
<template v-else-if="attachment.attributes.pdf_previewable"> <template v-else-if="attachment.attributes.pdf_previewable && attachment.attributes.pdf !== null">
<PdfViewer :pdf="attachment.attributes.pdf" /> <PdfViewer :pdf="attachment.attributes.pdf" />
</template> </template>
<template v-else-if="attachment.attributes.large_preview !== null"> <template v-else-if="attachment.attributes.large_preview !== null">

View file

@ -79,7 +79,7 @@ class AssetSerializer < ActiveModel::Serializer
{ {
url: object.pdf? ? asset_download_path(object) : asset_pdf_preview_path(object), url: object.pdf? ? asset_download_path(object) : asset_pdf_preview_path(object),
size: !object.pdf? && object.pdf_preview_ready? ? object.file_pdf_preview&.blob&.byte_size : object.file_size, size: !object.pdf? && object.pdf_preview_ready? ? object.file_pdf_preview&.blob&.byte_size : object.file_size,
worker_url: asset_path('pdf_js_worker.js') worker_url: ActionController::Base.helpers.asset_path('pdf_js_worker.js')
} }
end end