attempt to recognize when holes in timeline for various reasons, clear timeline and fetch older when showing new to get rid of holes

This commit is contained in:
shpuld 2017-11-21 16:12:47 +02:00
parent 8020363680
commit fc1736618b
5 changed files with 31 additions and 5 deletions

View file

@ -9,6 +9,7 @@ export const defaultState = {
notifications: [],
favorites: new Set(),
error: false,
flushMarker: 0,
timelines: {
mentions: {
statuses: [],
@ -422,6 +423,9 @@ export const mutations = {
each(notifications, (notification) => {
notification.seen = true
})
},
queueFlush (state, { timeline, id }) {
state.timelines[timeline].flushMarker = id
}
}
@ -458,6 +462,9 @@ const statuses = {
// Optimistic retweeting...
commit('setRetweeted', { status, value: true })
apiService.retweet({ id: status.id, credentials: rootState.users.currentUser.credentials })
},
queueFlush ({ rootState, commit }, { timeline, id }) {
commit('queueFlush', { timeline, id })
}
},
mutations