update favorite number earlier
This commit is contained in:
parent
ff3a7e8b5b
commit
28c2a700e1
|
@ -402,6 +402,15 @@ export const mutations = {
|
|||
},
|
||||
setFavorited (state, { status, value }) {
|
||||
const newStatus = state.allStatusesObject[status.id]
|
||||
|
||||
if (newStatus.favorited !== value) {
|
||||
if (value) {
|
||||
newStatus.fave_num++
|
||||
} else {
|
||||
newStatus.fave_num--
|
||||
}
|
||||
}
|
||||
|
||||
newStatus.favorited = value
|
||||
},
|
||||
setFavoritedConfirm (state, { status, user }) {
|
||||
|
|
Loading…
Reference in New Issue