Merge branch 'fix_loading_flicker' into 'develop'
Throttle fetching old statuses to prevent spam, especially during scroll Closes #176 See merge request pleroma/pleroma-fe!393
This commit is contained in:
commit
25a88da17a
@ -2,6 +2,7 @@ import Status from '../status/status.vue'
|
|||||||
import timelineFetcher from '../../services/timeline_fetcher/timeline_fetcher.service.js'
|
import timelineFetcher from '../../services/timeline_fetcher/timeline_fetcher.service.js'
|
||||||
import StatusOrConversation from '../status_or_conversation/status_or_conversation.vue'
|
import StatusOrConversation from '../status_or_conversation/status_or_conversation.vue'
|
||||||
import UserCard from '../user_card/user_card.vue'
|
import UserCard from '../user_card/user_card.vue'
|
||||||
|
import { throttle } from 'lodash'
|
||||||
|
|
||||||
const Timeline = {
|
const Timeline = {
|
||||||
props: [
|
props: [
|
||||||
@ -88,7 +89,7 @@ const Timeline = {
|
|||||||
this.paused = false
|
this.paused = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fetchOlderStatuses () {
|
fetchOlderStatuses: throttle(function () {
|
||||||
const store = this.$store
|
const store = this.$store
|
||||||
const credentials = store.state.users.currentUser.credentials
|
const credentials = store.state.users.currentUser.credentials
|
||||||
store.commit('setLoading', { timeline: this.timelineName, value: true })
|
store.commit('setLoading', { timeline: this.timelineName, value: true })
|
||||||
@ -101,7 +102,7 @@ const Timeline = {
|
|||||||
userId: this.userId,
|
userId: this.userId,
|
||||||
tag: this.tag
|
tag: this.tag
|
||||||
}).then(() => store.commit('setLoading', { timeline: this.timelineName, value: false }))
|
}).then(() => store.commit('setLoading', { timeline: this.timelineName, value: false }))
|
||||||
},
|
}, 1000, this),
|
||||||
fetchFollowers () {
|
fetchFollowers () {
|
||||||
const id = this.userId
|
const id = this.userId
|
||||||
this.$store.state.api.backendInteractor.fetchFollowers({ id })
|
this.$store.state.api.backendInteractor.fetchFollowers({ id })
|
||||||
|
Loading…
Reference in New Issue
Block a user