1
0
Fork 0

avoid conditional declare config

This commit is contained in:
gluzzati 2024-03-21 18:26:57 +00:00
parent 8a5849dedb
commit 410c4930ef
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import api from "../../services/api.service";
import Markdown from "markdown-to-jsx"; import Markdown from "markdown-to-jsx";
import useConfig from "../../hooks/config.hook"; import useConfig from "../../hooks/config.hook";
const FilePreviewContext = React.createContext<{ const FilePreviewContext = React.createContext<{
shareId: string; shareId: string;
fileId: string; fileId: string;
@ -36,8 +37,8 @@ const FilePreview = ({
mimeType: string; mimeType: string;
}) => { }) => {
const [isNotSupported, setIsNotSupported] = useState(false); const [isNotSupported, setIsNotSupported] = useState(false);
if (isNotSupported) return <UnSupportedFile />;
const config = useConfig(); const config = useConfig();
if (isNotSupported) return <UnSupportedFile />;
return ( return (
<Stack> <Stack>
<FilePreviewContext.Provider <FilePreviewContext.Provider