Move addNewStatuses code around.

This commit is contained in:
Roger Braun 2016-11-21 16:33:08 +01:00
parent 47ddf8c3fb
commit 281c71b191

View file

@ -99,8 +99,7 @@ const mergeOrAdd = (arr, item) => {
} }
} }
export const mutations = { const addNewStatuses = (state, { statuses, showImmediately = false, timeline, user = {} }) => {
addNewStatuses (state, { statuses, showImmediately = false, timeline, user = {} }) {
const allStatuses = state.allStatuses const allStatuses = state.allStatuses
const timelineObject = state.timelines[timeline] const timelineObject = state.timelines[timeline]
@ -193,7 +192,10 @@ export const mutations = {
timelineObject.visibleStatuses = sortBy(timelineObject.visibleStatuses, ({id}) => -id) timelineObject.visibleStatuses = sortBy(timelineObject.visibleStatuses, ({id}) => -id)
timelineObject.statuses = sortBy(timelineObject.statuses, ({id}) => -id) timelineObject.statuses = sortBy(timelineObject.statuses, ({id}) => -id)
timelineObject.minVisibleId = (last(timelineObject.statuses) || {}).id timelineObject.minVisibleId = (last(timelineObject.statuses) || {}).id
}, }
export const mutations = {
addNewStatuses,
showNewStatuses (state, { timeline }) { showNewStatuses (state, { timeline }) {
const oldTimeline = (state.timelines[timeline]) const oldTimeline = (state.timelines[timeline])