on master help sign in
Fix typo, "recieved" -> "received"
d8ec87cFang
src/lib/useMailer.js+4−4
@@ -9,14 +9,14 @@ const STUB_MAILER = process.env.REACT_APP_STUB_MAILER === 'true';
9function useHasReceivedCache() {
9function useHasReceivedCache() {
10 const [cache, addToCache] = useSetState();
10 const [cache, addToCache] = useSetState();
11
11
12− const getHasRecieved = useCallback(
12+ const getHasReceived = useCallback(
13 email => cache[email] || Nothing(), //
13 email => cache[email] || Nothing(), //
14 [cache]
14 [cache]
15 );
15 );
16
16
17 const syncHasReceivedForEmail = useCallback(
17 const syncHasReceivedForEmail = useCallback(
18 async email => {
18 async email => {
19− if (Just.hasInstance(getHasRecieved(email))) {
19+ if (Just.hasInstance(getHasReceived(email))) {
20 // never update the cache after we know about it
20 // never update the cache after we know about it
21 return;
21 return;
22 }
22 }
@@ -29,10 +29,10 @@ function useHasReceivedCache() {
29 const _hasReceived = await hasReceived(email);
29 const _hasReceived = await hasReceived(email);
30 addToCache({ [email]: Just(_hasReceived) });
30 addToCache({ [email]: Just(_hasReceived) });
31 },
31 },
32− [getHasRecieved, addToCache]
32+ [getHasReceived, addToCache]
33 );
33 );
34
34
35− return { getHasRecieved, syncHasReceivedForEmail };
35+ return { getHasReceived, syncHasReceivedForEmail };
36}
36}
37
37
38export default function useMailer(emails) {
38export default function useMailer(emails) {
src/views/Invite/InviteEmail.js+3−3
@@ -101,7 +101,7 @@ export default function InviteEmail() {
101 const { syncInvites, getInvites } = usePointCache();
101 const { syncInvites, getInvites } = usePointCache();
102 const { pointCursor } = usePointCursor();
102 const { pointCursor } = usePointCursor();
103 const point = need.point(pointCursor);
103 const point = need.point(pointCursor);
104− const { getHasRecieved, syncHasReceivedForEmail, sendMail } = useMailer();
104+ const { getHasReceived, syncHasReceivedForEmail, sendMail } = useMailer();
105
105
106 const { availableInvites } = getInvites(point);
106 const { availableInvites } = getInvites(point);
107 const maxInvitesToSend = availableInvites.matchWith({
107 const maxInvitesToSend = availableInvites.matchWith({
@@ -142,14 +142,14 @@ export default function InviteEmail() {
142 () =>
142 () =>
143 inputConfigs.map(config => {
143 inputConfigs.map(config => {
144 config.disabled = !canInput;
144 config.disabled = !canInput;
145− const hasReceivedError = getHasRecieved(config.name).matchWith({
145+ const hasReceivedError = getHasReceived(config.name).matchWith({
146 Nothing: () => null, // loading
146 Nothing: () => null, // loading
147 Just: p => p.value && HAS_RECEIVED_TEXT,
147 Just: p => p.value && HAS_RECEIVED_TEXT,
148 });
148 });
149 config.error = hasReceivedError || errors[config.name];
149 config.error = hasReceivedError || errors[config.name];
150 return config;
150 return config;
151 }),
151 }),
152− [inputConfigs, errors, canInput, getHasRecieved]
152+ [inputConfigs, errors, canInput, getHasReceived]
153 );
153 );
154
154
155 // construct the state of the set of inputs we're rendering below
155 // construct the state of the set of inputs we're rendering below