Skip to content

Commit

Permalink
Merge pull request #1382 from mfts/fix/small-fixes
Browse files Browse the repository at this point in the history
fix: small fixes
  • Loading branch information
mfts authored Nov 11, 2024
2 parents 8a6dcbd + cc6d03a commit e404527
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/folders/add-folder-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function AddFolderModal({
"Content-Type": "application/json",
},
body: JSON.stringify({
name: folderName,
name: folderName.trim(),
path: currentFolderPath?.join("/"),
}),
},
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion components/folders/edit-folder-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function EditFolderModal({
},
body: JSON.stringify({
folderId: folderId,
name: folderName,
name: folderName.trim(),
}),
},
);
Expand Down
2 changes: 1 addition & 1 deletion components/upload-zone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
}

Expand Down

0 comments on commit e404527

Please sign in to comment.