Merge branch 'RED-7273' into 'master'
RED-7273: fixed viewer not opening docx files. See merge request redactmanager/red-ui!308
This commit is contained in:
commit
1cab4c8709
@ -201,13 +201,14 @@ export class PdfViewer {
|
|||||||
|
|
||||||
this.fileId = file.fileId;
|
this.fileId = file.fileId;
|
||||||
this.dossierId = file.dossierId;
|
this.dossierId = file.dossierId;
|
||||||
|
const filename = file?.filename.endsWith('.pdf') ? file?.filename : `${file?.filename}.pdf`;
|
||||||
|
|
||||||
this._logger.info('[PDF] Loading document...');
|
this._logger.info('[PDF] Loading document...');
|
||||||
|
|
||||||
await this.runWithCleanup(async () => {
|
await this.runWithCleanup(async () => {
|
||||||
const document = await this.documentViewer.getDocument()?.getPDFDoc();
|
const document = await this.documentViewer.getDocument()?.getPDFDoc();
|
||||||
await document?.lock();
|
await document?.lock();
|
||||||
this.#instance.UI.loadDocument(blob, { documentId: file.fileId, filename: file?.filename ?? 'document.pdf', onError });
|
this.#instance.UI.loadDocument(blob, { documentId: file.fileId, filename: filename ?? 'document.pdf', onError });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user