diff --git a/src/Components/Home/Filter.js b/src/Components/Home/Filter.js index 184bb815..3549c555 100644 --- a/src/Components/Home/Filter.js +++ b/src/Components/Home/Filter.js @@ -19,7 +19,7 @@ export const Filter = props => { let alert; if (incompleteTasks.length === 0) { - alert = 'noAlert' + alert = 'filterButton' } else { alert = 'Alert' } diff --git a/src/Components/NewTask/NewTask.js b/src/Components/NewTask/NewTask.js index 04ff72c8..b22895e9 100644 --- a/src/Components/NewTask/NewTask.js +++ b/src/Components/NewTask/NewTask.js @@ -112,7 +112,7 @@ class NewTask extends React.Component { notificationId: notificationId }; - createTask(payload, id) + createTask(payload, id, categoryID) .then(() => { this.props.updateFilteredTask([]); this.props.timePeriod('Today'); @@ -135,7 +135,7 @@ class NewTask extends React.Component { notificationId: notificationId }; - createTask(payload, id) + createTask(payload, id, categoryID) .then(() => { this.props.updateFilteredTask([]); this.props.timePeriod('Today'); @@ -157,7 +157,7 @@ class NewTask extends React.Component { end_time, notificationId: notificationId }; - createTask(payload, id) + createTask(payload, id, categoryID) .then(() => { this.props.updateFilteredTask([]); this.props.timePeriod('Today'); diff --git a/src/Components/TaskList/index.js b/src/Components/TaskList/index.js index e0009c68..27dc3d12 100644 --- a/src/Components/TaskList/index.js +++ b/src/Components/TaskList/index.js @@ -37,7 +37,8 @@ class editTaskList extends React.Component { taskList: list }) } - itemArr = [] + + itemArr = []; check = item => { var task = item.id console.log(task) @@ -58,6 +59,7 @@ class editTaskList extends React.Component { this.classBTN(item) console.log(this.itemArr) } + classBTN = item => { console.log("hitting check") $("#containter") @@ -66,7 +68,7 @@ class editTaskList extends React.Component { } arrar = [] - complete = () => { + complete = async () => { for (var i = 0; i < this.itemArr.length; i++) { this.arrar.push(this.itemArr[i]) } @@ -75,7 +77,7 @@ class editTaskList extends React.Component { this.getTaskById(id) }) - setTimeout(() => { + await setTimeout(() => { window.location.reload(true) }, 500) } @@ -87,14 +89,11 @@ class editTaskList extends React.Component { this.tasksById.push(task) } }) - // console.log(this.tasksById) this.setState( { retrievedTasks: this.tasksById }, () => { - // console.log(this.state.retrievedTasks); - this.state.retrievedTasks.map(task => { const id = task.id const payload = { @@ -119,7 +118,7 @@ class editTaskList extends React.Component { }, setTimeout(() => { window.location.reload(true) - }, 100) + }, 500) ) } @@ -133,7 +132,6 @@ class editTaskList extends React.Component { return task.status === true }) - // render content to page render() { return (