@@ -106,7 +106,7 @@ function ActionButtons({ actions = [] }) {
107export default function Points() {
107export default function Points() {
108 const { wallet } = useWallet();
108 const { wallet } = useWallet();
109− const { pop, push, popAndPush, names } = useHistory();
109+ const { pop, push, names } = useHistory();
110 const { setPointCursor } = usePointCursor();
110 const { setPointCursor } = usePointCursor();
111 const { controlledPoints, getDetails } = usePointCache();
111 const { controlledPoints, getDetails } = usePointCache();
112 const { contracts } = useNetwork();
112 const { contracts } = useNetwork();
@@ -119,11 +119,7 @@ export default function Points() {
119 const { syncStarReleaseDetails, starReleaseDetails } = useStarReleaseCache();
119 const { syncStarReleaseDetails, starReleaseDetails } = useStarReleaseCache();
121 const outgoingPoints = useMemo(
121 const outgoingPoints = useMemo(
123− pointList.filter(
122+ () => pointList.filter(({ isOutgoing }) => isOutgoing),
124− ({ isTransferProxySet, isTransferProxy }) =>
125− isTransferProxySet && !isTransferProxy
127 [pointList]
123 [pointList]
@@ -164,47 +160,38 @@ export default function Points() {
165 [getDetails, controlledPoints, _contracts]
161 [getDetails, controlledPoints, _contracts]
164+ const allPoints = pointList
166+ ({ isTransferProxySet, shouldDisplay }) =>
167+ !isTransferProxySet && shouldDisplay
169+ .map(({ value }) => value);
167− // if we can only interact with a single point, forget about the existence
171+ // if we can only interact with a single point, jump to the point page.
168− // of this page and jump to the point page.
169 // if there are any pending transfers, incoming or outgoing, stay on this
172 // if there are any pending transfers, incoming or outgoing, stay on this
170 // page, because those can only be completed/cancelled here.
173 // page, because those can only be completed/cancelled here.
171 useEffect(() => {
174 useEffect(() => {
172 if (Nothing.hasInstance(starReleaseDetails)) {
175 if (Nothing.hasInstance(starReleaseDetails)) {
175− controlledPoints.matchWith({
176− Nothing: () => null,
182− ...c.value.ownedPoints,
183− ...c.value.votingPoints,
184− ...c.value.managingPoints,
185− ...c.value.spawningPoints,
188− all.length === 1 &&
179+ allPoints.length === 1 &&
189− incomingPoints.length === 0 &&
180+ incomingPoints.length === 0 &&
190− outgoingPoints.length === 0 &&
181+ outgoingPoints.length === 0 &&
191− (starReleaseDetails.value === null ||
182+ (starReleaseDetails.value === null ||
192− starReleaseDetails.value.total === 0)
183+ starReleaseDetails.value.total === 0)
194− setPointCursor(Just(all[0]));
185+ setPointCursor(Just(allPoints[0]));
195− popAndPush(names.POINT);
186+ push(names.POINT);
202− controlledPoints,
189+ allPoints,
203 rejectedPoints,
190 rejectedPoints,
204 outgoingPoints,
191 outgoingPoints,
205 incomingPoints,
192 incomingPoints,
206 setPointCursor,
193 setPointCursor,
207− popAndPush,
194+ push,
209 starReleaseDetails,
196 starReleaseDetails,
@@ -216,13 +203,6 @@ export default function Points() {
216 const ownedPoints = maybeGetResult(controlledPoints, 'ownedPoints', []);
203 const ownedPoints = maybeGetResult(controlledPoints, 'ownedPoints', []);
217 const lockedPoints = maybeLockedPoints.getOrElse([]);
204 const lockedPoints = maybeLockedPoints.getOrElse([]);
219− const allPoints = pointList
221− ({ isTransferProxySet, shouldDisplay }) =>
222− !isTransferProxySet && shouldDisplay
224− .map(({ value }) => value);
226 const processingPoints = pointList
206 const processingPoints = pointList
227 .filter(({ shouldDisplay }) => !shouldDisplay)
207 .filter(({ shouldDisplay }) => !shouldDisplay)
228 .map(({ value }) => value);
208 .map(({ value }) => value);
@@ -298,11 +278,7 @@ export default function Points() {
298 outgoingPoints.length === 0 &&
278 outgoingPoints.length === 0 &&
299 !starReleasing)
279 !starReleasing)
303− <LoadingOverlay loading />
281+ return <LoadingOverlay loading />;