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
Signed by untrusted user who does not match committer: nbsp
GPG key ID: 9D3F2B64F2341B62

View file

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