From e2f825266a967029ef163ecc8cfb8e5d26a5e635 Mon Sep 17 00:00:00 2001 From: ValD Date: Thu, 13 Dec 2018 23:11:36 +0530 Subject: [PATCH] added condition to check for logined user --- src/components/user_card/user_card.js | 3 +++ src/components/user_card/user_card.vue | 4 ++-- src/i18n/en.json | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index a019627a..b8eb28e3 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -14,6 +14,9 @@ const UserCard = { components: { UserCardContent }, + computed: { + currentUser () { return this.$store.state.users.currentUser } + }, methods: { toggleUserExpanded () { this.userExpanded = !this.userExpanded diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 5a8e5531..eb0d7576 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -10,13 +10,13 @@
- {{ $t('user_card.follows_you') }} + {{ currentUser.id == user.id ? $t('user_card.its_you') : $t('user_card.follows_you') }}
{{ user.name }} - {{ $t('user_card.follows_you') }} + {{ currentUser.id == user.id ? $t('user_card.its_you') : $t('user_card.follows_you') }}
diff --git a/src/i18n/en.json b/src/i18n/en.json index 9101c993..1c43794a 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -324,6 +324,7 @@ "followers": "Followers", "following": "Following!", "follows_you": "Follows you!", + "its_you": "It's you!", "mute": "Mute", "muted": "Muted", "per_day": "per day",