fix: use correct listId to load next tasks

This commit is contained in:
Dominik Pschenitschni 2021-10-11 16:59:21 +02:00
parent 7c3ece5816
commit 0b68a473ef
No known key found for this signature in database
GPG key ID: B257AC0149F43A77

View file

@ -126,7 +126,7 @@
</div> </div>
<div <div
:ref="(el) => setTaskContainerRef(bucket.id, el)" :ref="(el) => setTaskContainerRef(bucket.id, el)"
@scroll="(el) => handleTaskContainerScroll(bucket.id, el)" @scroll="($event) => handleTaskContainerScroll(bucket.id, bucket.listId, $event.target)"
class="tasks" class="tasks"
> >
<draggable <draggable
@ -318,6 +318,7 @@ export default {
return this.list.isSavedFilter && !this.list.isSavedFilter() return this.list.isSavedFilter && !this.list.isSavedFilter()
}, },
loadBucketParameter() { loadBucketParameter() {
console.log('loadBucketParameter changed')
return { return {
listId: this.$route.params.listId, listId: this.$route.params.listId,
params: this.params, params: this.params,
@ -382,7 +383,10 @@ export default {
this.taskContainerRefs[id] = el this.taskContainerRefs[id] = el
}, },
handleTaskContainerScroll(id, el) { handleTaskContainerScroll(id, listId, el) {
if (!el) {
return
}
const scrollTopMax = el.scrollHeight - el.clientHeight const scrollTopMax = el.scrollHeight - el.clientHeight
const threshold = el.scrollTop + el.scrollTop * MIN_SCROLL_HEIGHT_PERCENT const threshold = el.scrollTop + el.scrollTop * MIN_SCROLL_HEIGHT_PERCENT
if (scrollTopMax > threshold) { if (scrollTopMax > threshold) {
@ -390,7 +394,7 @@ export default {
} }
this.$store.dispatch('kanban/loadNextTasksForBucket', { this.$store.dispatch('kanban/loadNextTasksForBucket', {
listId: this.$route.params.listId, listId: listId,
params: this.params, params: this.params,
bucketId: id, bucketId: id,
}) })