mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-11 10:27:01 +02:00
fix: pdf preview tries to render on server
This commit is contained in:
@@ -40,7 +40,9 @@ const FilePreview = ({
|
||||
if (isNotSupported) return <UnSupportedFile />;
|
||||
|
||||
if (mimeType == "application/pdf") {
|
||||
window.location.href = `/api/shares/${shareId}/files/${fileId}?download=false`;
|
||||
if (typeof window !== "undefined") {
|
||||
window.location.href = `/api/shares/${shareId}/files/${fileId}?download=false`;
|
||||
}
|
||||
return null;
|
||||
} else if (mimeType.startsWith("video/")) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user