forked from AkkomaGang/akkoma-fe
update favorite number earlier
This commit is contained in:
parent
ff3a7e8b5b
commit
28c2a700e1
1 changed files with 9 additions and 0 deletions
|
@ -402,6 +402,15 @@ export const mutations = {
|
||||||
},
|
},
|
||||||
setFavorited (state, { status, value }) {
|
setFavorited (state, { status, value }) {
|
||||||
const newStatus = state.allStatusesObject[status.id]
|
const newStatus = state.allStatusesObject[status.id]
|
||||||
|
|
||||||
|
if (newStatus.favorited !== value) {
|
||||||
|
if (value) {
|
||||||
|
newStatus.fave_num++
|
||||||
|
} else {
|
||||||
|
newStatus.fave_num--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
newStatus.favorited = value
|
newStatus.favorited = value
|
||||||
},
|
},
|
||||||
setFavoritedConfirm (state, { status, user }) {
|
setFavoritedConfirm (state, { status, user }) {
|
||||||
|
|
Loading…
Reference in a new issue