diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/DnDWrapper/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/DnDWrapper/index.jsx index 32b58560fa..32999e11c6 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/DnDWrapper/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/DnDWrapper/index.jsx @@ -30,7 +30,6 @@ export function DnDFileUploaderProvider({ workspace, children }) { const { user } = useUser(); useEffect(() => { - if (!!user && user.role === "default") return; System.checkDocumentProcessorOnline().then((status) => setReady(status)); }, [user]); @@ -111,6 +110,8 @@ export function DnDFileUploaderProvider({ workspace, children }) { type: "attachment", }); } else { + // If the user is a default user, we do not want to allow them to upload files. + if (!!user && user.role === "default") continue; newAccepted.push({ uid: v4(), file, @@ -146,6 +147,8 @@ export function DnDFileUploaderProvider({ workspace, children }) { type: "attachment", }); } else { + // If the user is a default user, we do not want to allow them to upload files. + if (!!user && user.role === "default") continue; newAccepted.push({ uid: v4(), file, @@ -216,6 +219,8 @@ export default function DnDFileUploaderWrapper({ children }) { onDragEnter: () => setDragging(true), onDragLeave: () => setDragging(false), }); + const { user } = useUser(); + const canUploadAll = !user || user?.role !== "default"; return (
Add anything
++ Add {canUploadAll ? "anything" : "an image"} +
- Drop your file here to embed it into your
- workspace auto-magically.
+ {canUploadAll ? (
+ <>
+ Drop your file here to embed it into your
+ workspace auto-magically.
+ >
+ ) : (
+ <>
+ Drop your image here to chat with it
+ auto-magically.
+ >
+ )}