Fix loading tasks for the first page after navigating to a new list
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2019-12-17 23:03:55 +01:00
parent 11d9aaae12
commit d041384999
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 13 additions and 4 deletions

View File

@ -132,11 +132,15 @@
this.listService = new ListService()
this.taskService = new TaskService()
this.taskCollectionService = new TaskCollectionService()
this.taskEditTask = null
this.isTaskEdit = false
this.loadTasks(1)
this.initTasks(1)
},
methods: {
// This function initializes the tasks page and loads the first page of tasks
initTasks(page) {
this.taskEditTask = null
this.isTaskEdit = false
this.loadTasks(page)
},
addTask() {
let task = new TaskModel({text: this.newTaskText, listID: this.$route.params.id})
this.taskService.create(task)
@ -191,7 +195,12 @@
})
},
loadTasksForPage(e) {
this.loadTasks(e.page)
// The page parameter can be undefined, in the case where the user loads a new list from the side bar menu
let page = e.page
if (typeof e.page === 'undefined') {
page = 1
}
this.initTasks(page)
},
markAsDone(e) {
let updateFunc = () => {