Skip to content

Commit

Permalink
fix(Infinite Load): exit early if no entries
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jul 25, 2022
1 parent 5d19c27 commit 3a8fc10
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions components/pages/posts/navigation/page/PostsControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,30 @@ import KeyboardNavigationMixin from '~/components/pages/posts/navigation/page/Ke
export default {
directives: {
Intersect,
Intersect
},
mixins: [KeyboardNavigationMixin],
props: {
currentPage: {
type: Number,
required: true,
required: true
},
minimumPage: {
type: Number,
required: true,
required: true
},
forceNormalControls: {
type: Boolean,
default: false,
},
default: false
}
},
computed: {
...mapGetters('user', ['getUserSettings']),
...mapGetters('user', ['getUserSettings'])
},
methods: {
Expand Down Expand Up @@ -146,7 +146,9 @@ export default {
const elementAttribute = 'data-is-visible'
const timeoutDelay = 1500
// console.log({ entries, observer })
if (!entries || !entries.length) {
return
}
entries.forEach((entry) => {
// console.debug(entry.intersectionRatio)
Expand Down Expand Up @@ -176,7 +178,7 @@ export default {
await this.getNextPage()
}, timeoutDelay)
})
},
},
}
}
}
</script>

0 comments on commit 3a8fc10

Please sign in to comment.