1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-11-05 07:20:13 +01:00

fix: pdf preview tries to render on server

This commit is contained in:
Elias Schneider 2023-02-13 09:39:27 +01:00
parent 6419da07fb
commit c3af0fe097
No known key found for this signature in database
GPG Key ID: 07E623B294202B6C

View File

@ -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 (