Stop blink from loading more statuses with every scroll.

This commit is contained in:
csaurus 2018-04-22 16:12:34 -04:00
parent b6eb1b1d98
commit 59f98aecd9

View File

@ -105,7 +105,8 @@ const Timeline = {
.then((friends) => this.$store.dispatch('addFriends', { friends })) .then((friends) => this.$store.dispatch('addFriends', { friends }))
}, },
scrollLoad (e) { scrollLoad (e) {
const height = Math.max(document.body.offsetHeight, document.body.scrollHeight) const bodyBRect = document.body.getBoundingClientRect();
const height = Math.max(bodyBRect.height, -(bodyBRect.y))
if (this.timeline.loading === false && if (this.timeline.loading === false &&
this.$store.state.config.autoLoad && this.$store.state.config.autoLoad &&
this.$el.offsetHeight > 0 && this.$el.offsetHeight > 0 &&