diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/conversation/conversation.js | 6 | ||||
| -rw-r--r-- | src/components/status/status.js | 7 | ||||
| -rw-r--r-- | src/components/status/status.vue | 8 | ||||
| -rw-r--r-- | src/components/timeline/timeline.vue | 3 |
4 files changed, 13 insertions, 11 deletions
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 5cc7f4ee..ffeb7244 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -41,8 +41,7 @@ const conversation = { props: [ 'statusoid', 'collapsable', - 'isPage', - 'timelineName' + 'isPage' ], created () { if (this.isPage) { @@ -121,8 +120,6 @@ const conversation = { if (this.status) { this.$store.state.api.backendInteractor.fetchConversation({id: this.status.id}) .then(({ancestors, descendants}) => { - this.$store.dispatch('fetchFavoritedByUsers', { id: this.statusId, retweetedStatusId: this.status.id, timelineName: this.timelineName }) - this.$store.dispatch('fetchRebloggedByUsers', { id: this.statusId, retweetedStatusId: this.status.id, timelineName: this.timelineName }) this.$store.dispatch('addNewStatuses', { statuses: ancestors }) this.$store.dispatch('addNewStatuses', { statuses: descendants }) }) @@ -142,6 +139,7 @@ const conversation = { }, setHighlight (id) { this.highlight = id + this.$store.dispatch('fetchFavsAndRepeats', id) }, getHighlight () { return this.isExpanded ? this.highlight : null 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> diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue index 147e8a1d..e6a8d458 100644 --- a/src/components/timeline/timeline.vue +++ b/src/components/timeline/timeline.vue @@ -16,13 +16,12 @@ </div> <div :class="classes.body"> <div class="timeline"> - <conversation + <conversation v-for="status in timeline.visibleStatuses" class="status-fadein" :key="status.id" :statusoid="status" :collapsable="true" - :timelineName="timelineName" /> </div> </div> |
