don't display muted label on profile since backend doesn't work this way

improve display logic for mute/block cards
This commit is contained in:
Henry Jameson 2026-01-07 23:15:23 +02:00
commit 0dc8305e95
5 changed files with 15 additions and 25 deletions

View file

@ -15,10 +15,10 @@ const BlockCard = {
return this.relationship.blocking return this.relationship.blocking
}, },
blockExpiryAvailable () { blockExpiryAvailable () {
return this.user.block_expires_at !== undefined return Object.hasOwn(this.user, 'block_expires_at')
}, },
blockExpiry () { blockExpiry () {
return this.user.block_expires_at == null return this.user.block_expires_at === false
? 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()])
}, },

View file

@ -14,10 +14,10 @@ const MuteCard = {
return this.relationship.muting return this.relationship.muting
}, },
muteExpiryAvailable () { muteExpiryAvailable () {
return this.user.mute_expires_at !== undefined return Object.hasOwn(this.user, 'mute_expires_at')
}, },
muteExpiry () { muteExpiry () {
return this.user.mute_expires_at == null return this.user.mute_expires_at === false
? 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()])
} }

View file

@ -122,12 +122,8 @@ export default {
data () { data () {
const user = this.$store.getters.findUser(this.userId) const user = this.$store.getters.findUser(this.userId)
console.log('LOL', JSON.parse(JSON.stringify(user)))
return { return {
followRequestInProgress: false, followRequestInProgress: false,
muteExpiryAmount: 0,
muteExpiryUnit: 'minutes',
// Editable stuff // Editable stuff
editImage: false, editImage: false,
@ -261,15 +257,15 @@ export default {
return 'note' in this.relationship return 'note' in this.relationship
}, },
muteExpiryAvailable () { muteExpiryAvailable () {
return this.user.mute_expires_at !== undefined return Object.hasOwn(this.user, 'mute_expires_at')
}, },
muteExpiry () { muteExpiry () {
return this.user.mute_expires_at == null return this.user.mute_expires_at === false
? 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 () { blockExpiryAvailable () {
return this.user.block_expires_at !== undefined return Object.hasOwn(this.user, 'block_expires_at')
}, },
blockExpiry () { blockExpiry () {
return this.user.block_expires_at == null return this.user.block_expires_at == null

View file

@ -212,18 +212,6 @@
> >
{{ $t('user_card.group') }} {{ $t('user_card.group') }}
</span> </span>
<span
v-if="relationship.muting && muteExpiryAvailable"
class="alert neutral user-role"
>
{{ muteExpiry }}
</span>
<span
v-if="relationship.blocking && blockExpiryAvailable"
class="alert neutral user-role"
>
{{ blockExpiry }}
</span>
</template> </template>
</div> </div>
</div> </div>

View file

@ -51,8 +51,14 @@ export const parseUser = (data) => {
output.screen_name = data.acct output.screen_name = data.acct
output.fqn = data.fqn output.fqn = data.fqn
output.statusnet_profile_url = data.url output.statusnet_profile_url = data.url
output.mute_expires_at = data.mute_expires_at
output.block_expires_at = data.block_expires_at if (Object.hasOwn(data, 'mute_expires_at')) {
output.mute_expires_at = data.mute_expires_at == null ? false : data.mute_expires_at
}
if (Object.hasOwn(data, 'block_expires_at')) {
output.block_expires_at = data.block_expires_at == null ? false : data.block_expires_at
}
// There's nothing else to get // There's nothing else to get
if (mastoShort) { if (mastoShort) {