mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe.git
synced 2024-11-09 01:49:14 +00:00
refetch favs and repeats when stats are changed
This commit is contained in:
parent
17498ef906
commit
e9b6e0e2b7
1 changed files with 13 additions and 0 deletions
|
@ -402,6 +402,9 @@ const Status = {
|
|||
setMedia () {
|
||||
const attachments = this.attachmentSize === 'hide' ? this.status.attachments : this.galleryAttachments
|
||||
return () => this.$store.dispatch('setMedia', attachments)
|
||||
},
|
||||
refetchFavsAndRepeats () {
|
||||
this.$store.dispatch('fetchFavsAndRepeats', this.status.id)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -419,6 +422,16 @@ const Status = {
|
|||
window.scrollBy(0, rect.bottom - window.innerHeight + 50)
|
||||
}
|
||||
}
|
||||
},
|
||||
'status.repeat_num': function (num) {
|
||||
if (this.isFocused && this.statusFromGlobalRepository.rebloggedBy && this.statusFromGlobalRepository.rebloggedBy.length !== num) {
|
||||
this.refetchFavsAndRepeats()
|
||||
}
|
||||
},
|
||||
'status.fave_num': function (num) {
|
||||
if (this.isFocused && this.statusFromGlobalRepository.favoritedBy && this.statusFromGlobalRepository.favoritedBy.length !== num) {
|
||||
this.refetchFavsAndRepeats()
|
||||
}
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
|
|
Loading…
Reference in a new issue