diff options
| author | Brenden Bice <brenden.next@gmail.com> | 2019-04-09 11:45:33 -0400 |
|---|---|---|
| committer | Brenden Bice <brenden.next@gmail.com> | 2019-04-11 23:26:13 -0400 |
| commit | 8ed4eb8a7ffe0e370cfc06017d2bce34b2c9d987 (patch) | |
| tree | 0142857ce6518bf132347c6ce56d7a0436e778dd /src/components/status | |
| parent | f74a6b4b5777211dcda979b0e390305f46efdd95 (diff) | |
refactor showing favs and repeats logic
Diffstat (limited to 'src/components/status')
| -rw-r--r-- | src/components/status/status.js | 7 | ||||
| -rw-r--r-- | src/components/status/status.vue | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index 44caf3af..db234ec1 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -98,6 +98,10 @@ const Status = { return this.statusoid } }, + statusFromGlobalRepository () { + // NOTE: Consider to replace status with statusFromGlobalRepository + return this.$store.state.statuses.allStatusesObject[this.status.id] + }, loggedIn () { return !!this.$store.state.users.currentUser }, @@ -260,7 +264,8 @@ const Status = { return this.status.summary_html + '<br />' + this.status.statusnet_html }, combinedFavsAndRepeatsAvatars () { - const combinedAvatars = [].concat(this.statusoid.favoritedBy, this.statusoid.rebloggedBy).filter(_ => _) + // Use the status from the global status repository since favs and repeats are saved in it + const combinedAvatars = [].concat(this.statusFromGlobalRepository.favoritedBy, this.statusFromGlobalRepository.rebloggedBy).filter(_ => _) return uniqBy(combinedAvatars, 'id') } }, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 34bb64d0..b0882964 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -136,13 +136,13 @@ <transition name="fade"> <div class="favs-repeated-users" v-if="combinedFavsAndRepeatsAvatars.length > 0 && isFocused"> <ul class="stats"> - <li class="stat-count" v-if="statusoid.rebloggedBy && statusoid.rebloggedBy.length > 0"> + <li class="stat-count" v-if="statusFromGlobalRepository.rebloggedBy && statusFromGlobalRepository.rebloggedBy.length > 0"> <a class="stat-title">{{ $t('settings.notification_visibility_repeats') }}</a> - <div class="stat-number">{{ statusoid.rebloggedBy.length }}</div> + <div class="stat-number">{{ statusFromGlobalRepository.rebloggedBy.length }}</div> </li> - <li class="stat-count" v-if="statusoid.favoritedBy && statusoid.favoritedBy.length > 0"> + <li class="stat-count" v-if="statusFromGlobalRepository.favoritedBy && statusFromGlobalRepository.favoritedBy.length > 0"> <a class="stat-title">{{ $t('user_card.favorites') }}</a> - <div class="stat-number">{{ statusoid.favoritedBy.length }}</div> + <div class="stat-number">{{ statusFromGlobalRepository.favoritedBy.length }}</div> </li> <li class="avatar-row"> <AvatarList :avatars='combinedFavsAndRepeatsAvatars'></AvatarList> |
