From 410c4930ef97a00f9ea7288d18002f3d4e66734c Mon Sep 17 00:00:00 2001 From: gluzzati Date: Thu, 21 Mar 2024 18:26:57 +0000 Subject: [PATCH] avoid conditional declare config --- frontend/src/components/share/FilePreview.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/share/FilePreview.tsx b/frontend/src/components/share/FilePreview.tsx index 0d06f9c..43b8f1b 100644 --- a/frontend/src/components/share/FilePreview.tsx +++ b/frontend/src/components/share/FilePreview.tsx @@ -14,6 +14,7 @@ import api from "../../services/api.service"; import Markdown from "markdown-to-jsx"; import useConfig from "../../hooks/config.hook"; + const FilePreviewContext = React.createContext<{ shareId: string; fileId: string; @@ -36,8 +37,8 @@ const FilePreview = ({ mimeType: string; }) => { const [isNotSupported, setIsNotSupported] = useState(false); - if (isNotSupported) return ; const config = useConfig(); + if (isNotSupported) return ; return (