forked from AkkomaGang/akkoma-fe
Show already added accounts in search
This commit is contained in:
parent
d1af4bdd51
commit
dea803468f
2 changed files with 12 additions and 4 deletions
|
@ -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({
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue