apiclient
This commit is contained in:
@@ -268,7 +268,7 @@ const DocumentViewerPanel: React.FC<DocumentViewerPanelProps> = ({
|
||||
if (!href) {
|
||||
return null;
|
||||
}
|
||||
const contentType = document.current_version?.version?.content_type || document.content_type || null;
|
||||
const contentType = document.content_type || null;
|
||||
const filename = document.current_version?.filename || document.filename || document.title || null;
|
||||
return {
|
||||
url: href,
|
||||
@@ -363,15 +363,13 @@ const DocumentViewerPanel: React.FC<DocumentViewerPanelProps> = ({
|
||||
if (!resolvedDocumentLink?.url || !document) {
|
||||
return null;
|
||||
}
|
||||
const docContentType = document.content_type;
|
||||
const versionContentType = document.current_version?.version?.content_type;
|
||||
const normalizedContentType = resolvedDocumentLink.contentType || docContentType || versionContentType || null;
|
||||
const normalizedContentType = document.content_type || null;
|
||||
return {
|
||||
url: resolvedDocumentLink.url,
|
||||
alt: document.title,
|
||||
contentType: normalizedContentType || undefined,
|
||||
};
|
||||
}, [resolvedDocumentLink?.url, resolvedDocumentLink?.contentType, document]);
|
||||
}, [document, resolvedDocumentLink?.url]);
|
||||
|
||||
const headerActions = createDocumentViewerHeaderActions({
|
||||
document,
|
||||
|
||||
Reference in New Issue
Block a user