From 9217ca84762848ad05d15ae8beb42975c156786c Mon Sep 17 00:00:00 2001 From: Sol Fisher Romanoff Date: Thu, 16 Jun 2022 13:38:24 +0300 Subject: [PATCH] Fetch all users in list before displaying --- src/components/list_edit/list_edit.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/list_edit/list_edit.js b/src/components/list_edit/list_edit.js index 42316e03..3ae0459a 100644 --- a/src/components/list_edit/list_edit.js +++ b/src/components/list_edit/list_edit.js @@ -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) {