diff --git a/src/components/lists/ShowList.vue b/src/components/lists/ShowList.vue index a9b89a0b..725e3220 100644 --- a/src/components/lists/ShowList.vue +++ b/src/components/lists/ShowList.vue @@ -59,6 +59,7 @@ auth.user.infos.type !== authType.LINK_SHARE && this.$route.params.type !== 'gantt' && this.$route.params.type !== 'table' && + this.$route.params.type !== 'list' && this.$route.params.type !== '' ) { router.push({name: 'showList', params: { id: this.$route.params.id }}) diff --git a/src/components/tasks/ShowListTasks.vue b/src/components/tasks/ShowListTasks.vue index 2f522251..002f8ab6 100644 --- a/src/components/tasks/ShowListTasks.vue +++ b/src/components/tasks/ShowListTasks.vue @@ -143,7 +143,6 @@ }, created() { this.taskService = new TaskService() - this.initTasks(1) }, methods: { // This function initializes the tasks page and loads the first page of tasks diff --git a/src/components/tasks/helpers/taskList.js b/src/components/tasks/helpers/taskList.js index 74ebfcf7..eaed13f4 100644 --- a/src/components/tasks/helpers/taskList.js +++ b/src/components/tasks/helpers/taskList.js @@ -19,6 +19,11 @@ export default { watch: { '$route.query': 'loadTasksForPage', // Only listen for query path changes }, + beforeMount() { + // Triggering loading the tasks in beforeMount lets the component maintain the current page, therefore the page + // is not lost after navigating back from a task detail page for example. + this.loadTasksForPage(this.$route.query) + }, created() { this.taskCollectionService = new TaskCollectionService() }, @@ -67,7 +72,7 @@ export default { }, loadTasksForPage(e) { // 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 + let page = Number(e.page) if (typeof e.page === 'undefined') { page = 1 }