@@ -189,24 +189,30 @@ export default function InviteEmail() {
191 //TODO want to do this on-input, but that gets weird. see #188
191 //TODO want to do this on-input, but that gets weird. see #188
192− let errorCount = 0;
192+ let knowAll = true;
193+ let alreadyReceived = [];
193 await Promise.all(
194 await Promise.all(
194 inputs.map(async input => {
195 inputs.map(async input => {
195 const email = input.data;
196 const email = input.data;
196 const hasReceived = getHasReceived(email).matchWith({
197 const hasReceived = getHasReceived(email).matchWith({
197− Nothing: () => false, // loading
198+ Nothing: () => 'unknown', // loading
198 Just: p => p.value,
199 Just: p => p.value,
200− if (hasReceived) {
201+ if (hasReceived === 'unknown') {
201− errorCount++;
202+ knowAll = false;
202− addError({
203+ } else if (hasReceived) {
203− [input.name]: `${email} has already received an invite.`,
204+ alreadyReceived.push(email);
208− if (errorCount > 0) {
208+ if (!knowAll) {
209+ throw new Error('No word yet from email service...');
211+ if (alreadyReceived.length > 0) {
209− throw new Error(`Some of these already have a point!`);
212+ throw new Error(
213+ 'The following recipients already own a point: ' +
214+ alreadyReceived.join(', ')
212 const nonce = await _web3.eth.getTransactionCount(_wallet.address);
218 const nonce = await _web3.eth.getTransactionCount(_wallet.address);
@@ -231,6 +237,7 @@ export default function InviteEmail() {
232 clearInvites();
238 clearInvites();
233 // NB(shrugs) - must be processed in serial because main thread, etc
239 // NB(shrugs) - must be processed in serial because main thread, etc
234 for (let i = 0; i < inputs.length; i++) {
241 for (let i = 0; i < inputs.length; i++) {
235 const input = inputs[i];
242 const input = inputs[i];