|
|
@ -460,35 +460,14 @@ export const mutations = {
|
|
|
|
queueFlush (state, { timeline, id }) {
|
|
|
|
queueFlush (state, { timeline, id }) {
|
|
|
|
state.timelines[timeline].flushMarker = id
|
|
|
|
state.timelines[timeline].flushMarker = id
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addFavoritedByUsers (state, { favoritedByUsers, id, timelineName }) {
|
|
|
|
addFavsAndRepeats (state, { id, favoritedByUsers, rebloggedByUsers }) {
|
|
|
|
if (timelineName) {
|
|
|
|
|
|
|
|
state.timelines[timelineName].visibleStatusesObject[id] = {
|
|
|
|
|
|
|
|
...state.timelines[timelineName].visibleStatusesObject[id],
|
|
|
|
|
|
|
|
favoritedBy: favoritedByUsers
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
state.timelines[timelineName].visibleStatuses = state.timelines[timelineName].visibleStatuses.map(visibleStatus => visibleStatus.id === id ? { ...visibleStatus, favoritedBy: favoritedByUsers } : visibleStatus)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
state.allStatusesObject[id] = {
|
|
|
|
|
|
|
|
...state.allStatusesObject[id],
|
|
|
|
|
|
|
|
favoritedBy: favoritedByUsers
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
addRebloggedByUsers (state, { rebloggedByUsers, id, timelineName }) {
|
|
|
|
|
|
|
|
if (timelineName) {
|
|
|
|
|
|
|
|
state.timelines[timelineName].visibleStatusesObject[id] = {
|
|
|
|
|
|
|
|
...state.timelines[timelineName].visibleStatusesObject[id],
|
|
|
|
|
|
|
|
rebloggedBy: rebloggedByUsers
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
state.timelines[timelineName].visibleStatuses = state.timelines[timelineName].visibleStatuses.map(visibleStatus => visibleStatus.id === id ? { ...visibleStatus, rebloggedBy: rebloggedByUsers } : visibleStatus)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
state.allStatusesObject[id] = {
|
|
|
|
state.allStatusesObject[id] = {
|
|
|
|
...state.allStatusesObject[id],
|
|
|
|
...state.allStatusesObject[id],
|
|
|
|
|
|
|
|
favoritedBy: favoritedByUsers,
|
|
|
|
rebloggedBy: rebloggedByUsers
|
|
|
|
rebloggedBy: rebloggedByUsers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const statuses = {
|
|
|
|
const statuses = {
|
|
|
|
state: defaultState(),
|
|
|
|
state: defaultState(),
|
|
|
@ -553,11 +532,9 @@ const statuses = {
|
|
|
|
credentials: rootState.users.currentUser.credentials
|
|
|
|
credentials: rootState.users.currentUser.credentials
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
fetchFavoritedByUsers ({ rootState, commit }, { id, retweetedStatusId, timelineName }) {
|
|
|
|
fetchFavsAndRepeats ({ rootState, commit }, id) {
|
|
|
|
rootState.api.backendInteractor.fetchFavoritedByUsers({id}).then((favoritedByUsers) => commit('addFavoritedByUsers', { favoritedByUsers, id: retweetedStatusId, timelineName }))
|
|
|
|
Promise.all([rootState.api.backendInteractor.fetchFavoritedByUsers(id), rootState.api.backendInteractor.fetchRebloggedByUsers(id)])
|
|
|
|
},
|
|
|
|
.then(([favoritedByUsers, rebloggedByUsers]) => commit('addFavsAndRepeats', { id, favoritedByUsers, rebloggedByUsers }))
|
|
|
|
fetchRebloggedByUsers ({ rootState, commit }, { id, retweetedStatusId, timelineName }) {
|
|
|
|
|
|
|
|
rootState.api.backendInteractor.fetchRebloggedByUsers({id}).then((rebloggedByUsers) => commit('addRebloggedByUsers', { rebloggedByUsers, id: retweetedStatusId, timelineName }))
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mutations
|
|
|
|
mutations
|
|
|
|