on master help sign in
revert changes to old Invite Email view
c833a0aLiam Fitzgerald
src/views/Invite/InviteEmail.js+13−11
@@ -66,7 +66,7 @@ import timeout from 'lib/timeout';
66const INITIAL_VALUES = { emails: [''] };
66const INITIAL_VALUES = { emails: [''] };
67
67
68const GAS_LIMIT = GAS_LIMITS.GIFT_PLANET;
68const GAS_LIMIT = GAS_LIMITS.GIFT_PLANET;
69−// const HAS_RECEIVED_TEXT = 'This email has already received an invite.';
69+const HAS_RECEIVED_TEXT = 'This email has already received an invite.';
70
70
71const STATUS = {
71const STATUS = {
72 INPUT: 'INPUT',
72 INPUT: 'INPUT',
@@ -110,7 +110,7 @@ export default function InviteEmail() {
110 const { syncInvites, getInvites } = usePointCache();
110 const { syncInvites, getInvites } = usePointCache();
111 const { pointCursor } = usePointCursor();
111 const { pointCursor } = usePointCursor();
112 const point = need.point(pointCursor);
112 const point = need.point(pointCursor);
113− const { sendMail } = useMailer();
113+ const { getHasReceived, sendMail } = useMailer();
114 const { gasPrice } = useGasPrice();
114 const { gasPrice } = useGasPrice();
115
115
116 const cachedEmails = useRef({});
116 const cachedEmails = useRef({});
@@ -142,12 +142,15 @@ export default function InviteEmail() {
142 const isFailed = status === STATUS.FAILURE;
142 const isFailed = status === STATUS.FAILURE;
143 const isDone = status === STATUS.SUCCESS;
143 const isDone = status === STATUS.SUCCESS;
144
144
145− const validateHasReceived = useCallback(async email => {
145+ const validateHasReceived = useCallback(
146+ async email => {
146− // const hasReceived = await getHasReceived(email);
147+ const hasReceived = await getHasReceived(email);
147− // if (hasReceived) {
148+ if (hasReceived) {
148− // return HAS_RECEIVED_TEXT;
149+ return HAS_RECEIVED_TEXT;
149− // }
150+ }
150− }, []);
151+ },
152+ [getHasReceived]
153+ );
151
154
152 const validateForm = useCallback((values, errors) => {
155 const validateForm = useCallback((values, errors) => {
153 if (hasErrors(errors)) {
156 if (hasErrors(errors)) {
@@ -381,13 +384,12 @@ export default function InviteEmail() {
381 }, [
384 }, [
382 web3,
385 web3,
383 wallet,
386 wallet,
384− gasPrice,
385 point,
387 point,
386− clearReceipts,
388+ gasPrice,
387 invites,
389 invites,
390+ clearReceipts,
388 addReceipt,
391 addReceipt,
389 sendMail,
392 sendMail,
390− message,
391 ]);
393 ]);
392
394
393 const onSubmit = useCallback(
395 const onSubmit = useCallback(