close modal faster

This commit is contained in:
DavidWells 2018-06-20 20:31:39 -07:00
parent 56590ba57a
commit 41f5090e2c

View file

@ -186,9 +186,12 @@ export default class App extends Component {
this.setState({ this.setState({
todos: data.optimisticState todos: data.optimisticState
}, () => { }, () => {
setTimeout(() => {
this.closeModal()
}, 600)
api.batchDelete(data.completedTodoIds).then(() => { api.batchDelete(data.completedTodoIds).then(() => {
console.log(`Batch removal complete`, data.completedTodoIds) console.log(`Batch removal complete`, data.completedTodoIds)
this.closeModal()
}).catch((e) => { }).catch((e) => {
console.log('An API error occurred', e) console.log('An API error occurred', e)
}) })