on master help sign in
Added planet check
c250bdaWill Galebach
src/lib/useRoller.ts+7−3
@@ -274,8 +274,6 @@ export default function useRoller() {
274 Just({ point: point, has: hasTransferProxy(details) })
274 Just({ point: point, has: hasTransferProxy(details) })
275 )
275 )
276 );
276 );
277− // if we have details for every point,
278− // return the array of pending transfers.
279 if (points.every((p: any) => Just.hasInstance(p))) {
277 if (points.every((p: any) => Just.hasInstance(p))) {
280 const outgoing = points
278 const outgoing = points
281 .filter((p: any) => p.value.has)
279 .filter((p: any) => p.value.has)
@@ -288,7 +286,13 @@ export default function useRoller() {
288 })
286 })
289 );
287 );
290
288
291− possibleMissingInvites = maybeOutgoingPoints.getOrElse([]);
289+ possibleMissingInvites = maybeOutgoingPoints
290+ .getOrElse([])
291+ .filter(
292+ (p: number) =>
293+ azimuth.azimuth.getPointSize(p) ===
294+ azimuth.azimuth.PointSize.Planet
295+ );
292 }
296 }
293
297
294 // Iterate over all spawned and controlled planets
298 // Iterate over all spawned and controlled planets
src/views/Invite/Cohort.js+16−7
@@ -75,19 +75,28 @@ export default function InviteCohort() {
75
75
76 const setUpInvite = async () => {
76 const setUpInvite = async () => {
77 setLoading(true);
77 setLoading(true);
78− const [invitePoint] = await azimuth.azimuth.getUnspawnedChildren(
78+ const possiblePoints = await azimuth.azimuth.getUnspawnedChildren(
79 _contracts,
79 _contracts,
80 point
80 point
81 );
81 );
82
82
83− // TODO: figure out how to store the ticket and invite info
83+ const invitePoint = possiblePoints.find(
84− const { ticket, owner } = await wg.generateTemporaryDeterministicWallet(
84+ p =>
85− point,
85+ azimuth.azimuth.getPointSize(p) === azimuth.azimuth.PointSize.Planet
86− _authToken
87 );
86 );
88
87
88+ if (invitePoint) {
89+ const { ticket, owner } = await wg.generateTemporaryDeterministicWallet(
90+ point,
91+ _authToken
92+ );
93+
89− construct(invitePoint, owner.keys.address);
94+ construct(invitePoint, owner.keys.address);
90− setL1Invite({ ticket, planet: invitePoint });
95+ setL1Invite({ ticket, planet: invitePoint });
96+ } else {
97+ setError('No available planets');
98+ }
99+
91 setLoading(false);
100 setLoading(false);
92 };
101 };
93
102