diff --git a/packages/website/src/components/Uploader/Uploader.js b/packages/website/src/components/Uploader/Uploader.js index dadd1c64..8e6343ce 100644 --- a/packages/website/src/components/Uploader/Uploader.js +++ b/packages/website/src/components/Uploader/Uploader.js @@ -10,6 +10,7 @@ import { useDropzone } from "react-dropzone"; import { SkynetClient } from "skynet-js"; import { useTimeoutFn } from "react-use"; import ms from "ms"; +import useAuthenticatedStatus from "../../services/useAuthenticatedStatus"; import Link from "../Link"; const getFilePath = (file) => file.webkitRelativePath || file.path || file.name; @@ -147,6 +148,9 @@ const Uploader = () => { const [mode, setMode] = React.useState("file"); const [files, setFiles] = React.useState([]); + const { data: authenticationStatus } = useAuthenticatedStatus(); + const authenticated = authenticationStatus?.authenticated ?? false; + const handleDrop = async (acceptedFiles) => { if (mode === "directory" && acceptedFiles.length) { const rootDir = getRootDirectory(acceptedFiles[0]); // get the file path from the first file @@ -307,7 +311,7 @@ const Uploader = () => { )} - {files.length === 0 && ( + {files.length === 0 && !authenticated && (