add search to the mutes tab as well

This commit is contained in:
taehoon 2019-04-02 16:14:45 -04:00
parent 0bdb0e5a81
commit d58e08cf52
2 changed files with 13 additions and 1 deletions

View File

@ -79,7 +79,8 @@ const UserSettings = {
MuteList,
EmojiInput,
Autosuggest,
BlockCard
BlockCard,
MuteCard
},
computed: {
user () {
@ -347,6 +348,12 @@ const UserSettings = {
return !user || user.statusnet_blocking || user.id === this.$store.state.users.currentUser.id
})
},
filterUnMutedUsers (userIds) {
return reject(userIds, (userId) => {
const user = this.$store.getters.findUser(userId)
return !user || user.muted || user.id === this.$store.state.users.currentUser.id
})
},
queryUserIds (query) {
return userSearchApi.search({query, store: this.$store})
.then((users) => {

View File

@ -206,6 +206,11 @@
</div>
<div :label="$t('settings.mutes_tab')">
<div class="profile-edit-usersearch-wrapper">
<Autosuggest :filter="filterUnMutedUsers" :query="queryUserIds" placeholder="Search whom you want to mute">
<MuteCard slot-scope="row" :userId="row.item"/>
</Autosuggest>
</div>
<mute-list :refresh="true">
<template slot="empty">{{$t('settings.no_mutes')}}</template>
</mute-list>