show expiry only if available
This commit is contained in:
parent
9f0b65654e
commit
35c2e87131
6 changed files with 16 additions and 5 deletions
|
|
@ -14,8 +14,10 @@ const BlockCard = {
|
||||||
blocked () {
|
blocked () {
|
||||||
return this.relationship.blocking
|
return this.relationship.blocking
|
||||||
},
|
},
|
||||||
|
blockExpiryAvailable () {
|
||||||
|
return this.user.block_expires_at !== undefined
|
||||||
|
},
|
||||||
blockExpiry () {
|
blockExpiry () {
|
||||||
console.log(this.user)
|
|
||||||
return this.user.block_expires_at == null
|
return this.user.block_expires_at == null
|
||||||
? this.$t('user_card.block_expires_forever')
|
? this.$t('user_card.block_expires_forever')
|
||||||
: this.$t('user_card.block_expires_at', [new Date(this.user.mute_expires_at).toLocaleString()])
|
: this.$t('user_card.block_expires_at', [new Date(this.user.mute_expires_at).toLocaleString()])
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<basic-user-card :user="user">
|
<basic-user-card :user="user">
|
||||||
<div class="block-card-content-container">
|
<div class="block-card-content-container">
|
||||||
<span v-if="blocked" class="alert neutral">
|
<span v-if="blocked && blockExpiryAvailable" class="alert neutral">
|
||||||
{{ blockExpiry }}
|
{{ blockExpiry }}
|
||||||
</span>
|
</span>
|
||||||
{{ ' ' }}
|
{{ ' ' }}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ const MuteCard = {
|
||||||
muted () {
|
muted () {
|
||||||
return this.relationship.muting
|
return this.relationship.muting
|
||||||
},
|
},
|
||||||
|
muteExpiryAvailable () {
|
||||||
|
return this.user.mute_expires_at !== undefined
|
||||||
|
},
|
||||||
muteExpiry () {
|
muteExpiry () {
|
||||||
return this.user.mute_expires_at == null
|
return this.user.mute_expires_at == null
|
||||||
? this.$t('user_card.mute_expires_forever')
|
? this.$t('user_card.mute_expires_forever')
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<basic-user-card :user="user">
|
<basic-user-card :user="user">
|
||||||
<div class="mute-card-content-container">
|
<div class="mute-card-content-container">
|
||||||
<span v-if="muted" class="alert neutral">
|
<span v-if="muted && muteExpiryAvailable" class="alert neutral">
|
||||||
{{ muteExpiry }}
|
{{ muteExpiry }}
|
||||||
</span>
|
</span>
|
||||||
{{ ' ' }}
|
{{ ' ' }}
|
||||||
|
|
|
||||||
|
|
@ -159,11 +159,17 @@ export default {
|
||||||
supportsNote () {
|
supportsNote () {
|
||||||
return 'note' in this.relationship
|
return 'note' in this.relationship
|
||||||
},
|
},
|
||||||
|
muteExpiryAvailable () {
|
||||||
|
return this.user.mute_expires_at !== undefined
|
||||||
|
},
|
||||||
muteExpiry () {
|
muteExpiry () {
|
||||||
return this.user.mute_expires_at == null
|
return this.user.mute_expires_at == null
|
||||||
? this.$t('user_card.mute_expires_forever')
|
? this.$t('user_card.mute_expires_forever')
|
||||||
: this.$t('user_card.mute_expires_at', [new Date(this.user.mute_expires_at).toLocaleString()])
|
: this.$t('user_card.mute_expires_at', [new Date(this.user.mute_expires_at).toLocaleString()])
|
||||||
},
|
},
|
||||||
|
blockExpiryAvailable () {
|
||||||
|
return this.user.block_expires_at !== undefined
|
||||||
|
},
|
||||||
blockExpiry () {
|
blockExpiry () {
|
||||||
return this.user.block_expires_at == null
|
return this.user.block_expires_at == null
|
||||||
? this.$t('user_card.block_expires_forever')
|
? this.$t('user_card.block_expires_forever')
|
||||||
|
|
|
||||||
|
|
@ -137,13 +137,13 @@
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-if="relationship.muting"
|
v-if="relationship.muting && muteExpiryAvailable"
|
||||||
class="alert neutral user-role"
|
class="alert neutral user-role"
|
||||||
>
|
>
|
||||||
{{ muteExpiry }}
|
{{ muteExpiry }}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-if="relationship.blocking"
|
v-if="relationship.blocking && blockExpiryAvailable"
|
||||||
class="alert neutral user-role"
|
class="alert neutral user-role"
|
||||||
>
|
>
|
||||||
{{ blockExpiry }}
|
{{ blockExpiry }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue