diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/statuses.js | 8 | ||||
| -rw-r--r-- | src/services/status_poster/status_poster.service.js | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 5d604f0d..34fca47f 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -86,7 +86,7 @@ const mergeOrAdd = (arr, item) => { } } -const addNewStatuses = (state, { statuses, showImmediately = false, timeline, user = {} }) => { +const addNewStatuses = (state, { statuses, showImmediately = false, timeline, user = {}, noIdUpdate = false }) => { // Sanity check if (!isArray(statuses)) { return false @@ -97,7 +97,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us // Set the maxId to the new id if it's larger. const updateMaxId = ({id}) => { - if (!timeline) { return false } + if (!timeline || noIdUpdate) { return false } timelineObject.maxId = max([id, timelineObject.maxId]) } @@ -242,8 +242,8 @@ export const mutations = { const statuses = { state: defaultState, actions: { - addNewStatuses ({ rootState, commit }, { statuses, showImmediately = false, timeline = false }) { - commit('addNewStatuses', { statuses, showImmediately, timeline, user: rootState.users.currentUser }) + addNewStatuses ({ rootState, commit }, { statuses, showImmediately = false, timeline = false, noIdUpdate = false }) { + commit('addNewStatuses', { statuses, showImmediately, timeline, noIdUpdate, user: rootState.users.currentUser }) }, favorite ({ rootState, commit }, status) { // Optimistic favoriting... diff --git a/src/services/status_poster/status_poster.service.js b/src/services/status_poster/status_poster.service.js index 5b50231a..850993f7 100644 --- a/src/services/status_poster/status_poster.service.js +++ b/src/services/status_poster/status_poster.service.js @@ -7,8 +7,12 @@ const postStatus = ({ store, status, media = [], inReplyToStatusId = undefined } return apiService.postStatus({credentials: store.state.users.currentUser.credentials, status, mediaIds, inReplyToStatusId}) .then((data) => data.json()) .then((data) => { - store.dispatch('addNewStatuses', - { statuses: [data], timeline: 'friends', showImmediately: true }) + store.dispatch('addNewStatuses', { + statuses: [data], + timeline: 'friends', + showImmediately: true, + noIdUpdate: true // To prevent missing notices on next pull. + }) }) } |
