From d4e967ed8fc2f99d44b887ebabf0a4eb642ecaab Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 9 Oct 2020 01:47:59 -0400 Subject: simplified setting group users --- src/client/util/GroupManager.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/client/util') diff --git a/src/client/util/GroupManager.tsx b/src/client/util/GroupManager.tsx index fb3342e68..48e3ca737 100644 --- a/src/client/util/GroupManager.tsx +++ b/src/client/util/GroupManager.tsx @@ -59,17 +59,9 @@ export class GroupManager extends React.Component<{}> { */ populateUsers = async () => { if (!this.populating) { - this.populating = true; - runInAction(() => this.users = []); const userList = await RequestPromise.get(Utils.prepend("/getUsers")); const raw = JSON.parse(userList) as User[]; - const evaluating = raw.map(async user => { - const userSharingDocument = await DocServer.GetRefField(user.sharingDocumentId); - if (userSharingDocument instanceof Doc) { - runInAction(() => this.users.push(user.email)); - } - }); - return Promise.all(evaluating).then(() => this.populating = false); + raw.map(action(user => !this.users.some(umail => umail === user.email) && this.users.push(user.email))); } } -- cgit v1.2.3-70-g09d2