Fetch all users in list before displaying

This commit is contained in:
Sol Fisher Romanoff 2022-06-16 13:38:24 +03:00
parent ab7001ed20
commit 9217ca8476
No known key found for this signature in database
GPG key ID: 9D3F2B64F2341B62

View file

@ -40,11 +40,10 @@ const ListNew = {
return this.userIds.map(userId => this.findUser(userId))
},
selectedUsers () {
const users = this.selectedUserIds.map(userId => this.findUser(userId))
if (users.includes(undefined)) {
return []
for (let i = 0; i < this.selectedUserIds.length; i++) {
this.$store.dispatch('fetchUserIfMissing', this.selectedUserIds[i])
}
return users
return this.selectedUserIds.map(userId => this.findUser(userId))
},
availableUsers () {
if (this.query.length !== 0) {