From 2779cfc1403e0689e63386fc8b92824728b65456 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 20 Jul 2021 22:16:44 +0200 Subject: [PATCH] Fix not reloading tasks of a saved filter after editing it --- src/components/tasks/mixins/taskList.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/tasks/mixins/taskList.js b/src/components/tasks/mixins/taskList.js index a6e91c2d..963e6919 100644 --- a/src/components/tasks/mixins/taskList.js +++ b/src/components/tasks/mixins/taskList.js @@ -31,6 +31,7 @@ export default { }, watch: { '$route.query': 'loadTasksForPage', // Only listen for query path changes + '$route.path': 'loadTasksOnSavedFilter', }, beforeMount() { // Triggering loading the tasks in beforeMount lets the component maintain the current page, therefore the page @@ -45,13 +46,15 @@ export default { page, search = '', params = null, + forceLoading = false, ) { // Because this function is triggered every time on topNavigation, we're putting a condition here to only load it when we actually want to show tasks // FIXME: This is a bit hacky -> Cleanup. if ( this.$route.name !== 'list.list' && - this.$route.name !== 'list.table' + this.$route.name !== 'list.table' && + !forceLoading ) { return } @@ -72,7 +75,7 @@ export default { search: search, page: page, } - if (JSON.stringify(currentList) === JSON.stringify(this.loadedList)) { + if (JSON.stringify(currentList) === JSON.stringify(this.loadedList) && !forceLoading) { return } @@ -130,6 +133,11 @@ export default { } this.initTasks(page, search) }, + loadTasksOnSavedFilter() { + if(typeof this.$route.params.listId !== 'undefined' && parseInt(this.$route.params.listId) < 0) { + this.loadTasks(1, '', null, true) + } + }, sortTasks() { if (this.tasks === null || this.tasks === []) { return