From 37ed748b29edd0c92d74a6f64f1586dd242359af Mon Sep 17 00:00:00 2001 From: Raphael Beer Date: Thu, 19 Mar 2020 06:28:43 +0100 Subject: [PATCH] Fix: not updating on user prop change, translation keys --- webapp/components/features/FollowList.vue | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/webapp/components/features/FollowList.vue b/webapp/components/features/FollowList.vue index c46b4ca6a..7ba364a97 100644 --- a/webapp/components/features/FollowList.vue +++ b/webapp/components/features/FollowList.vue @@ -2,7 +2,7 @@ - {{ userName | truncate(15) }} {{ $t('profile.network.following') }} + {{ userName | truncate(15) }} {{ $t(`profile.network.${type}`) }} @@ -46,8 +46,7 @@ export default { }, data() { return { - connections: this.user[this.type], - allConnectionsCount: this.user[`${this.type}Count`], + additionalConnections: [], queries: { followedBy: followedByQuery, following: followingQuery, @@ -59,6 +58,12 @@ export default { const { name } = this.user || {} return name || this.$t('profile.userAnonym') }, + connections() { + return [...this.user[this.type], ...this.additionalConnections] + }, + allConnectionsCount() { + return this.user[`${this.type}Count`] + }, }, methods: { uniq(items, field = 'id') { @@ -70,8 +75,7 @@ export default { variables: { id: this.user.id }, // neither result nor update are being called when defined here (?) }) - const connections = data.User[0][this.type] - this.connections = this.connections.concat(connections) + this.additionalConnections = data.User[0][this.type] }, }, }