diff options
| author | Roger Braun <roger@rogerbraun.net> | 2016-11-28 21:25:36 +0100 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2016-11-28 21:25:36 +0100 |
| commit | 9681bb7bfd6b861fe2bfaa4532a4c36d476ae5cf (patch) | |
| tree | 5cd94fc8756a3f23fe43a17e10c74360201ed86d /src/modules/statuses.js | |
| parent | bb1b3c3975cbabd091b2be687157402b2395e712 (diff) | |
Add noIdUpdate option for addNewStatuses action.
This fixes #11.
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 8 |
1 files changed, 4 insertions, 4 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... |
