@@ -7,6 +7,7 @@ import { useHistory } from 'store/history';
7import { useWallet } from 'store/wallet';
7import { useWallet } from 'store/wallet';
8import { usePointCache } from 'store/pointCache';
8import { usePointCache } from 'store/pointCache';
9import { usePointCursor } from 'store/pointCursor';
9import { usePointCursor } from 'store/pointCursor';
10+import { useStarReleaseCache } from 'store/starRelease';
11import * as need from 'lib/need';
12import * as need from 'lib/need';
12import { isZeroAddress, abbreviateAddress } from 'lib/wallet';
13import { isZeroAddress, abbreviateAddress } from 'lib/wallet';
@@ -91,6 +92,7 @@ export default function Points() {
91 rejectedPoints,
92 rejectedPoints,
92 addRejectedPoint,
93 addRejectedPoint,
93 ] = useRejectedIncomingPointTransfers();
94 ] = useRejectedIncomingPointTransfers();
95+ const { syncStarReleaseDetails, starReleaseDetails } = useStarReleaseCache();
95 const maybeOutgoingPoints = useMemo(
97 const maybeOutgoingPoints = useMemo(
@@ -124,7 +126,10 @@ export default function Points() {
124 // if there are any pending transfers, incoming or outgoing, stay on this
126 // if there are any pending transfers, incoming or outgoing, stay on this
125 // page, because those can only be completed/cancelled here.
127 // page, because those can only be completed/cancelled here.
126 useEffect(() => {
128 useEffect(() => {
127− if (Nothing.hasInstance(maybeOutgoingPoints)) {
130+ Nothing.hasInstance(maybeOutgoingPoints) ||
131+ Nothing.hasInstance(starReleaseDetails)
130 controlledPoints.matchWith({
135 controlledPoints.matchWith({
@@ -145,7 +150,8 @@ export default function Points() {
146 all.length === 1 &&
151 all.length === 1 &&
147 incoming.length === 0 &&
152 incoming.length === 0 &&
148− maybeOutgoingPoints.value.length === 0
153+ maybeOutgoingPoints.value.length === 0 &&
154+ starReleaseDetails.value.total === 0
150 setPointCursor(Just(all[0]));
156 setPointCursor(Just(all[0]));
151 popAndPush(names.POINT);
157 popAndPush(names.POINT);
@@ -161,6 +167,7 @@ export default function Points() {
161 setPointCursor,
167 setPointCursor,
162 popAndPush,
168 popAndPush,
166 const address = need.addressFromWallet(wallet);
173 const address = need.addressFromWallet(wallet);
@@ -188,6 +195,13 @@ export default function Points() {
188 const displayEmptyState =
195 const displayEmptyState =
189 !loading && incomingPoints.length === 0 && allPoints.length === 0;
196 !loading && incomingPoints.length === 0 && allPoints.length === 0;
198+ const starReleasing = starReleaseDetails
199+ .map(s => s.total > 0)
203+ syncStarReleaseDetails();
204+ }, [syncStarReleaseDetails]);
191 // sync display details for known points
205 // sync display details for known points
192 useSyncKnownPoints([
206 useSyncKnownPoints([
193 ...ownedPoints,
207 ...ownedPoints,
@@ -204,11 +218,17 @@ export default function Points() {
221+ const goStarRelease = useCallback(() => push(names.STAR_RELEASE), [
208 loading ||
227 loading ||
209 (allPoints.length === 1 &&
228 (allPoints.length === 1 &&
210 incomingPoints.length === 0 &&
229 incomingPoints.length === 0 &&
211− outgoingPoints.length === 0)
230+ outgoingPoints.length === 0 &&
214 <View inset pop={pop}>
234 <View inset pop={pop}>
@@ -316,21 +336,35 @@ export default function Points() {
316 </Grid.Item>
336 </Grid.Item>
319− {isEclipticOwner && (
342+ {isEclipticOwner && (
323− <Grid.Item
344+ <Grid.Item
325− as={ForwardButton}
346+ as={ForwardButton}
326− detail="You have the authority to create a new Galaxy."
347+ detail="You have the authority to create a new Galaxy."
327− onClick={goCreateGalaxy}>
348+ onClick={goCreateGalaxy}>
328− Create a galaxy
349+ Create a galaxy
329− </Grid.Item>
350+ </Grid.Item>
330− <Grid.Divider />
351+ <Grid.Divider />
359+ detail="You have points being released"
360+ onClick={goStarRelease}>
331− </Grid>
362+ </Grid.Item>
332− </Footer>
363+ <Grid.Divider />