Show already added accounts in search

This commit is contained in:
Sol Fisher Romanoff 2022-06-16 09:41:07 +03:00
parent d1af4bdd51
commit dea803468f
Signed by untrusted user who does not match committer: nbsp
GPG Key ID: 9D3F2B64F2341B62
2 changed files with 12 additions and 4 deletions

View File

@ -20,7 +20,6 @@ const ListNew = {
data () {
return {
title: '',
suggestions: [],
userIds: [],
selectedUserIds: [],
loading: false,
@ -40,11 +39,18 @@ const ListNew = {
users () {
return this.userIds.map(userId => this.findUser(userId))
},
selectedUsers () {
const users = this.selectedUserIds.map(userId => this.findUser(userId))
if (users.includes(undefined)) {
return []
}
return users
},
availableUsers () {
if (this.query.length !== 0) {
return this.users
} else {
return this.suggestions
return this.selectedUsers
}
},
...mapState({

View File

@ -20,7 +20,6 @@ const ListNew = {
data () {
return {
title: '',
suggestions: [],
userIds: [],
selectedUserIds: [],
loading: false,
@ -31,11 +30,14 @@ const ListNew = {
users () {
return this.userIds.map(userId => this.findUser(userId))
},
selectedUsers () {
return this.selectedUserIds.map(userId => this.findUser(userId))
},
availableUsers () {
if (this.query.length !== 0) {
return this.users
} else {
return this.suggestions
return this.selectedUsers
}
},
...mapState({