diff --git a/components/folders/add-folder-modal.tsx b/components/folders/add-folder-modal.tsx index 9f2d6005f..7da9981e6 100644 --- a/components/folders/add-folder-modal.tsx +++ b/components/folders/add-folder-modal.tsx @@ -71,7 +71,7 @@ export function AddFolderModal({ "Content-Type": "application/json", }, body: JSON.stringify({ - name: folderName, + name: folderName.trim(), path: currentFolderPath?.join("/"), }), }, @@ -86,7 +86,7 @@ export function AddFolderModal({ const { parentFolderPath } = await response.json(); - analytics.capture("Folder Added", { folderName: folderName }); + analytics.capture("Folder Added", { folderName: folderName.trim() }); toast.success("Folder added successfully! 🎉"); mutate( diff --git a/components/folders/edit-folder-modal.tsx b/components/folders/edit-folder-modal.tsx index 83fd89e04..48611079c 100644 --- a/components/folders/edit-folder-modal.tsx +++ b/components/folders/edit-folder-modal.tsx @@ -61,7 +61,7 @@ export function EditFolderModal({ }, body: JSON.stringify({ folderId: folderId, - name: folderName, + name: folderName.trim(), }), }, ); diff --git a/components/upload-zone.tsx b/components/upload-zone.tsx index 01577c1ed..27a8ad4ac 100644 --- a/components/upload-zone.tsx +++ b/components/upload-zone.tsx @@ -350,7 +350,7 @@ export default function UploadZone({ const getFilesFromEvent = useCallback( async (event: DropEvent) => { // This callback also run when event.type =`dragenter`. We only need to compute files when the event.type is `drop`. - if (event.type !== "drop") { + if (event.type !== "drop" && event.type !== "change") { return []; }