fix: card composer no longer allows creates tasks with empty names

This commit is contained in:
Jordan Knott 2021-01-06 16:20:05 -06:00
parent 533b9511c9
commit 40b27aa1f1

View File

@ -38,8 +38,10 @@ const CardComposer = ({ isOpen, onCreateCard, onClose }: Props) => {
taskGroupID="" taskGroupID=""
editable editable
onEditCard={(_taskGroupID, _taskID, name) => { onEditCard={(_taskGroupID, _taskID, name) => {
onCreateCard(name); if (cardName.trim() !== '') {
setCardName(''); onCreateCard(name.trim());
setCardName('');
}
}} }}
onCardTitleChange={name => { onCardTitleChange={name => {
setCardName(name); setCardName(name);
@ -50,8 +52,10 @@ const CardComposer = ({ isOpen, onCreateCard, onClose }: Props) => {
<AddCardButton <AddCardButton
variant="relief" variant="relief"
onClick={() => { onClick={() => {
onCreateCard(cardName); if (cardName.trim() !== '') {
setCardName(''); onCreateCard(cardName.trim());
setCardName('');
}
}} }}
> >
Add Card Add Card