don't add empty task
This commit is contained in:
parent
df439a2d1f
commit
1222e7794c
@ -70,6 +70,10 @@ class App extends React.Component {
|
||||
|
||||
addTask(e) {
|
||||
e.preventDefault()
|
||||
if (this.state.newTask === '') {
|
||||
console.log('Not adding empty task.')
|
||||
return
|
||||
}
|
||||
this.setState({
|
||||
tasks: this.state.tasks.concat({
|
||||
id: this.state.tasks.length,
|
||||
|
Loading…
Reference in New Issue
Block a user