add back mute prediction, add getter for relationships
This commit is contained in:
parent
f6fce92cf7
commit
af9492977a
9 changed files with 21 additions and 8 deletions
|
@ -12,7 +12,7 @@ const BlockCard = {
|
|||
return this.$store.getters.findUser(this.userId)
|
||||
},
|
||||
relationship () {
|
||||
return this.$store.state.users.relationships[this.userId] || {}
|
||||
return this.$store.getters.relationship(this.userId)
|
||||
},
|
||||
blocked () {
|
||||
return this.relationship.blocking
|
||||
|
|
|
@ -20,7 +20,7 @@ const FollowCard = {
|
|||
return this.$store.state.users.currentUser
|
||||
},
|
||||
relationship () {
|
||||
return this.$store.state.users.relationships[this.user.id]
|
||||
return this.$store.getters.relationship(this.user.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ const MuteCard = {
|
|||
return this.$store.getters.findUser(this.userId)
|
||||
},
|
||||
relationship () {
|
||||
return this.$store.state.users.relationships[this.userId]
|
||||
return this.$store.getters.relationship(this.userId)
|
||||
},
|
||||
muted () {
|
||||
return this.relationship.muting
|
||||
|
|
|
@ -56,7 +56,7 @@ const Notification = {
|
|||
return this.generateUserProfileLink(this.targetUser)
|
||||
},
|
||||
needMute () {
|
||||
return (this.$store.state.users.relationships[this.user.id] || {}).muting
|
||||
return this.$store.getters.relationship(this.user.id).muting
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ const Status = {
|
|||
return hits
|
||||
},
|
||||
muted () {
|
||||
const relationship = this.$store.state.users.relationships[this.status.user.id] || {}
|
||||
const relationship = this.$store.getters.relationship(this.userId)
|
||||
return !this.unmuted && (
|
||||
(!(this.inProfile && this.status.user.id === this.profileUserId) && relationship.muting) ||
|
||||
(!this.inConversation && this.status.thread_muted) ||
|
||||
|
|
|
@ -25,7 +25,7 @@ export default {
|
|||
return this.$store.getters.findUser(this.userId)
|
||||
},
|
||||
relationship () {
|
||||
return this.$store.state.users.relationships[this.userId] || {}
|
||||
return this.$store.getters.relationship(this.userId)
|
||||
},
|
||||
classes () {
|
||||
return [{
|
||||
|
|
|
@ -351,13 +351,13 @@ const UserSettings = {
|
|||
},
|
||||
filterUnblockedUsers (userIds) {
|
||||
return reject(userIds, (userId) => {
|
||||
const relationship = this.$store.state.users.relationships[userId] || {}
|
||||
const relationship = this.$store.getters.relationship(this.userId)
|
||||
return relationship.blocking || userId === this.$store.state.users.currentUser.id
|
||||
})
|
||||
},
|
||||
filterUnMutedUsers (userIds) {
|
||||
return reject(userIds, (userId) => {
|
||||
const relationship = this.$store.state.users.relationships[userId] || {}
|
||||
const relationship = this.$store.getters.relationship(this.userId)
|
||||
return relationship.muting || userId === this.$store.state.users.currentUser.id
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue