From fc1736618b4e1a9f178c0ae287754c6ac1244b08 Mon Sep 17 00:00:00 2001 From: shpuld Date: Tue, 21 Nov 2017 16:12:47 +0200 Subject: attempt to recognize when holes in timeline for various reasons, clear timeline and fetch older when showing new to get rid of holes --- src/modules/statuses.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/modules/statuses.js') diff --git a/src/modules/statuses.js b/src/modules/statuses.js index d954b023..82a7eda1 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -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 -- cgit v1.2.3-70-g09d2