on master help sign in
Don't needlessly assign to variables
35c970aFang
src/views/Invite/InviteEmail.js+14−14
@@ -189,21 +189,21 @@ export default function InviteEmail() {
189
189
190 //TODO want to do this on-input, but that gets weird. see #188
190 //TODO want to do this on-input, but that gets weird. see #188
191 let errorCount = 0;
191 let errorCount = 0;
192+ await Promise.all(
192− const mailsVerified = inputs.map(async input => {
193+ inputs.map(async input => {
193− console.log('aaa', invites);
194− const email = input.data;
194+ const email = input.data;
195− const hasReceived = getHasReceived(email).matchWith({
195+ const hasReceived = getHasReceived(email).matchWith({
196− Nothing: () => false, // loading
196+ Nothing: () => false, // loading
197− Just: p => p.value,
197+ Just: p => p.value,
198− });
199− if (hasReceived) {
200− errorCount++;
201− addError({
202− [input.name]: `${email} has already received an invite.`,
203 });
198 });
199+ if (hasReceived) {
200+ errorCount++;
201+ addError({
202+ [input.name]: `${email} has already received an invite.`,
203+ });
204+ }
204− }
205+ })
205− });
206+ );
206− await Promise.all(mailsVerified);
207 if (errorCount > 0) {
207 if (errorCount > 0) {
208 throw new Error(`Some of these already have a point!`);
208 throw new Error(`Some of these already have a point!`);
209 }
209 }