improve performance by caching pinned status ids into user object
This commit is contained in:
parent
87de130ee5
commit
110c9d3b26
5 changed files with 29 additions and 15 deletions
|
@ -424,7 +424,7 @@ export const mutations = {
|
|||
newStatus.favoritedBy.push(user)
|
||||
}
|
||||
},
|
||||
setPinned (state, { status }) {
|
||||
setPinned (state, status) {
|
||||
const newStatus = state.allStatusesObject[status.id]
|
||||
newStatus.pinned = status.pinned
|
||||
},
|
||||
|
@ -543,11 +543,11 @@ const statuses = {
|
|||
},
|
||||
pinStatus ({ rootState, commit }, statusId) {
|
||||
return rootState.api.backendInteractor.pinOwnStatus(statusId)
|
||||
.then((status) => commit('setPinned', { status }))
|
||||
.then((status) => commit('setPinned', status))
|
||||
},
|
||||
unpinStatus ({ rootState, commit }, statusId) {
|
||||
rootState.api.backendInteractor.unpinOwnStatus(statusId)
|
||||
.then((status) => commit('setPinned', { status }))
|
||||
.then((status) => commit('setPinned', status))
|
||||
},
|
||||
retweet ({ rootState, commit }, status) {
|
||||
// Optimistic retweeting...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue