on master help sign in
refactor and remove debugging artifacts
777d700Liam Fitzgerald
src/form/BridgeForm.js−1
@@ -25,7 +25,6 @@ export default function BridgeForm({
25 async (...args) => {
25 async (...args) => {
26 const errors = await onSubmit(...args);
26 const errors = await onSubmit(...args);
27 if (errors) {
27 if (errors) {
28− console.log(errors);
29 return errors;
28 return errors;
30 }
29 }
31
30
src/form/FormError.js−1
@@ -25,7 +25,6 @@ export default function FormError(props) {
25
25
26 const warning = submitErrors && submitErrors[WARNING];
26 const warning = submitErrors && submitErrors[WARNING];
27 const showWarning = !!warning && !dirtySinceLastSubmit;
27 const showWarning = !!warning && !dirtySinceLastSubmit;
28− console.log(dirtySinceLastSubmit);
29
28
30 return showSubmitError || showValidationError || showWarning ? (
29 return showSubmitError || showValidationError || showWarning ? (
31 <ErrorText {...props}>
30 <ErrorText {...props}>
src/lib/inviteMail.js−2
@@ -37,8 +37,6 @@ function sendMail(recipient, ticket, sender, message, tx) {
37 sender,
37 sender,
38 message,
38 message,
39 tx,
39 tx,
40− }).then(() => {
41− throw new Error('test');
42 });
40 });
43}
41}
44
42
src/lib/router.js+2−2
@@ -12,7 +12,7 @@ import Invite from 'views/Invite';
12import Activate from 'views/Activate';
12import Activate from 'views/Activate';
13
13
14import PartySetPoolSize from 'views/Party/PartySetPoolSize';
14import PartySetPoolSize from 'views/Party/PartySetPoolSize';
15−import ShowParty from 'views/Party/ShowParty';
15+import InviteCohort from 'views/Invite/Cohort';
16import AcceptTransfer from 'views/AcceptTransfer';
16import AcceptTransfer from 'views/AcceptTransfer';
17import CancelTransfer from 'views/CancelTransfer';
17import CancelTransfer from 'views/CancelTransfer';
18
18
@@ -34,6 +34,6 @@ export const ROUTES = {
34 [ROUTE_NAMES.ACCEPT_TRANSFER]: AcceptTransfer,
34 [ROUTE_NAMES.ACCEPT_TRANSFER]: AcceptTransfer,
35 // TODO: replace this with deep link to AdminCancelTransfer
35 // TODO: replace this with deep link to AdminCancelTransfer
36 [ROUTE_NAMES.CANCEL_TRANSFER]: CancelTransfer,
36 [ROUTE_NAMES.CANCEL_TRANSFER]: CancelTransfer,
37− [ROUTE_NAMES.PARTY]: ShowParty,
37+ [ROUTE_NAMES.INVITE_COHORT]: InviteCohort,
38 [ROUTE_NAMES.STAR_RELEASE]: StarRelease,
38 [ROUTE_NAMES.STAR_RELEASE]: StarRelease,
39};
39};
src/lib/useInviter.js−3
@@ -71,7 +71,6 @@ const useInviter = () => {
71
71
72 const nonce = await _web3.eth.getTransactionCount(_wallet.address);
72 const nonce = await _web3.eth.getTransactionCount(_wallet.address);
73 const chainId = await _web3.eth.net.getId();
73 const chainId = await _web3.eth.net.getId();
74− debugger;
75 const planets = await azimuth.delegatedSending.getPlanetsToSend(
74 const planets = await azimuth.delegatedSending.getPlanetsToSend(
76 _contracts,
75 _contracts,
77 point,
76 point,
@@ -179,8 +178,6 @@ const useInviter = () => {
179
178
180 setTxStatus(STATUS.SUCCESS);
179 setTxStatus(STATUS.SUCCESS);
181 setInvites(confirmedInvites);
180 setInvites(confirmedInvites);
182− console.log(unsentInvites);
183− console.log(confirmedInvites);
184
181
185 if (unsentInvites.length > 0) {
182 if (unsentInvites.length > 0) {
186 return { errors: { [FORM_ERROR]: unsentInvites } };
183 return { errors: { [FORM_ERROR]: unsentInvites } };
src/store/lib/useInvitesStore.js−2
@@ -45,8 +45,6 @@ export default function useInvitesStore() {
45 const sentInvites = invitedPoints.length;
45 const sentInvites = invitedPoints.length;
46 const acceptedInvites = activity.filter(i => !!i).length;
46 const acceptedInvites = activity.filter(i => !!i).length;
47
47
48− console.log(invitedPoints);
49−
50 const [acceptedPoints, pendingPoints] = chain(invitedPoints)
48 const [acceptedPoints, pendingPoints] = chain(invitedPoints)
51 .zipWith(activity, (point, active) => ({
49 .zipWith(activity, (point, active) => ({
52 point,
50 point,
src/views/Invite/Cohort.js+5
@@ -90,6 +90,11 @@ function CohortList({ points, className }) {
90 <Grid.Item key={p} half={(idx % 2) + 1} as={CohortMember} point={p} />
90 <Grid.Item key={p} half={(idx % 2) + 1} as={CohortMember} point={p} />
91 ))}
91 ))}
92 </>
92 </>
93+ {visiblePoints.length === 0 && (
94+ <Grid.Item full className="p4 t-center">
95+ No invites accepted yet.
96+ </Grid.Item>
97+ )}
93 </Grid>
98 </Grid>
94 );
99 );
95}
100}
src/views/Invite/Email.js−1
@@ -193,7 +193,6 @@ const InviteMail = () => {
193 onSubmit={onSubmit}>
193 onSubmit={onSubmit}>
194 {({ handleSubmit, values }) => (
194 {({ handleSubmit, values }) => (
195 <>
195 <>
196− {console.log(values) && null}
197 <Grid.Item full as={EmailChipInput} name="emails" className="mt4" />
196 <Grid.Item full as={EmailChipInput} name="emails" className="mt4" />
198 {renderButton(handleSubmit)}
197 {renderButton(handleSubmit)}
199
198
src/views/Point.js+25−35
@@ -12,7 +12,7 @@ import Greeting from 'components/Greeting';
12import Passport from 'components/Passport';
12import Passport from 'components/Passport';
13import { ForwardButton, BootUrbitOSButton } from 'components/Buttons';
13import { ForwardButton, BootUrbitOSButton } from 'components/Buttons';
14import CopyButton from 'components/CopyButton';
14import CopyButton from 'components/CopyButton';
15−import { matchBlinky } from 'components/Blinky';
15+import Blinky, { matchBlinky } from 'components/Blinky';
16import DownloadSigilButton from 'components/DownloadSigilButton';
16import DownloadSigilButton from 'components/DownloadSigilButton';
17import BarGraph from 'components/BarGraph';
17import BarGraph from 'components/BarGraph';
18import Chip from 'components/Chip';
18import Chip from 'components/Chip';
@@ -63,6 +63,8 @@ export default function Point() {
63 const _totalInvites =
63 const _totalInvites =
64 sentInvites.getOrElse(0) + availableInvites.getOrElse(0);
64 sentInvites.getOrElse(0) + availableInvites.getOrElse(0);
65 const _pendingInvites = pendingPoints.getOrElse([]).length;
65 const _pendingInvites = pendingPoints.getOrElse([]).length;
66+
67+ const loadedInvites = Just.hasInstance(availableInvites);
66 //
68 //
67 // availableInvites.getOrElse(0) === 0
69 // availableInvites.getOrElse(0) === 0
68
70
@@ -72,7 +74,7 @@ export default function Point() {
72
74
73 const goInvite = useCallback(() => push(names.INVITE), [push, names]);
75 const goInvite = useCallback(() => push(names.INVITE), [push, names]);
74
76
75− const goParty = useCallback(() => push(names.PARTY), [push, names]);
77+ const goCohort = useCallback(() => push(names.INVITE_COHORT), [push, names]);
76
78
77 const goPartiesSetPoolSize = useCallback(
79 const goPartiesSetPoolSize = useCallback(
78 () => push(names.PARTY_SET_POOL_SIZE),
80 () => push(names.PARTY_SET_POOL_SIZE),
@@ -89,39 +91,22 @@ export default function Point() {
89 const [showInviteForm, setShowInviteForm] = useState(false);
91 const [showInviteForm, setShowInviteForm] = useState(false);
90
92
91 const inviteButton = (() => {
93 const inviteButton = (() => {
92− switch (azimuth.getPointSize(point)) {
94+ if (azimuth.getPointSize(point) === azimuth.PointSize.Star) {
93− case azimuth.PointSize.Planet:
94− const availableInvitesText = matchBlinky(availableInvites);
95− return (
96− <>
97− <Grid.Item
98− full
99− as={ForwardButton}
100− disabled={!isActiveOwner}
101− onClick={goInvite}>
102− Invite <sup>{availableInvitesText}</sup>
103− </Grid.Item>
104− <Grid.Divider />
105− </>
106− );
107− //
108− case azimuth.PointSize.Star:
109− return (
95+ return (
110− <>
96+ <>
111− <Grid.Item
97+ <Grid.Item
112− full
98+ full
113− as={ForwardButton}
99+ as={ForwardButton}
114− disabled={!isActiveOwner}
100+ disabled={!isActiveOwner}
115− onClick={goPartiesSetPoolSize}>
101+ onClick={goPartiesSetPoolSize}>
116− Manage Invite Pools
102+ Manage Invite Pools
117− </Grid.Item>
103+ </Grid.Item>
118− <Grid.Divider />
104+ <Grid.Divider />
119− </>
105+ </>
120− );
106+ );
121− //
122− default:
123− return null;
124 }
107 }
108+
109+ return null;
125 })();
110 })();
126
111
127 const senateButton = (() => {
112 const senateButton = (() => {
@@ -167,7 +152,7 @@ export default function Point() {
167 className={cn('t-right underline', {
152 className={cn('t-right underline', {
168 gray4: sentInvites.getOrElse(0) === 0,
153 gray4: sentInvites.getOrElse(0) === 0,
169 })}
154 })}
170− onClick={goParty}
155+ onClick={goCohort}
171 cols={[11, 13]}>
156 cols={[11, 13]}>
172 View
157 View
173 </Grid.Item>
158 </Grid.Item>
@@ -223,6 +208,11 @@ export default function Point() {
223 {showInviteForm && <Inviter />}
208 {showInviteForm && <Inviter />}
224 </>
209 </>
225 )}
210 )}
211+ {!loadedInvites && isPlanet && (
212+ <Grid.Item className="mv2" full>
213+ Invite Group <Blinky />
214+ </Grid.Item>
215+ )}
226 </Grid>
216 </Grid>
227 <Grid className="pt2">
217 <Grid className="pt2">
228 {inviteButton}
218 {inviteButton}