diff --git a/src/components/lists/views/Kanban.vue b/src/components/lists/views/Kanban.vue index e71868d3..bcac5061 100644 --- a/src/components/lists/views/Kanban.vue +++ b/src/components/lists/views/Kanban.vue @@ -247,10 +247,22 @@ }, computed: mapState({ buckets: state => state.kanban.buckets, + loadedListId: state => state.kanban.listId, loading: LOADING, }), methods: { loadBuckets() { + + // Prevent trying to load buckets if the task popup view is active + if(this.$route.name !== 'list.kanban') { + return + } + + // Only load buckets if we don't already loaded them + if(this.loadedListId === this.$route.params.listId) { + return + } + this.$store.dispatch('kanban/loadBucketsForList', this.$route.params.listId) .catch(e => { this.error(e, this) diff --git a/src/store/modules/kanban.js b/src/store/modules/kanban.js index 4a4201d8..e290d5f3 100644 --- a/src/store/modules/kanban.js +++ b/src/store/modules/kanban.js @@ -12,8 +12,12 @@ export default { namespaced: true, state: () => ({ buckets: [], + listId: 0, }), mutations: { + setListId(state, listId) { + state.listId = listId + }, setBuckets(state, buckets) { state.buckets = buckets }, @@ -119,6 +123,7 @@ export default { return bucketService.getAll({listId: listId}) .then(r => { ctx.commit('setBuckets', r) + ctx.commit('setListId', listId) return Promise.resolve() }) .catch(e => {