Skip to content

Commit

Permalink
fix: cleanup on select folder
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanFnz committed Dec 28, 2024
1 parent 63f0518 commit f826bff
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/dialog/folder-selection-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ export const FolderSelectionDialog: React.FC<FolderSelectionDialogProps> = ({
setNewFolderName('')
}

const handleSelectFolder = (folderId: number) => {
setIsCreatingNewFolder(false)
setValidationError(false)
if (setNewFolderName) setNewFolderName('')
onFolderSelect(folderId)
}

return (
<Dialog
visible={visible}
Expand Down Expand Up @@ -91,7 +98,7 @@ export const FolderSelectionDialog: React.FC<FolderSelectionDialogProps> = ({
<DropdownItem
key={folder.id}
isSelected={selectedFolderId === folder.id}
onPress={() => onFolderSelect(folder.id)}>
onPress={() => handleSelectFolder(folder.id)}>
<DropdownText isSelected={selectedFolderId === folder.id}>
{folder.folderName}
</DropdownText>
Expand Down

0 comments on commit f826bff

Please sign in to comment.