@@ -1,5 +1,4 @@
11import { useCallback, useEffect, useState } from 'react';
2−import { azimuth } from 'azimuth-js';
32import { Just } from 'folktale/maybe';
43import { Grid, Flex } from 'indigo-react';
54import { Box, Icon, Row, Button, Checkbox } from '@tlon/indigo-react';
@@ -12,7 +11,6 @@ import View from 'components/View';
1211import Greeting from 'components/Greeting';
1312import Passport from 'components/Passport';
1413import Blinky from 'components/Blinky';
15−import { ForwardButton } from 'components/Buttons';
1614import L2PointHeader from 'components/L2/Headers/L2PointHeader';
1715import LayerIndicator from 'components/L2/LayerIndicator';
1816import Card from 'components/L2/Card';
@@ -29,7 +27,7 @@ import { isL2 } from 'lib/utils/roller';
2927import { isDevelopment } from 'lib/flags';
3028import { usePointCache } from 'store/pointCache';
3129import Modal from 'components/L2/Modal';
32−import { isPlanet } from 'lib/utils/point';
30+import { isPlanet, isStar } from 'lib/utils/point';
3331import { useHasNetworkKeysSet } from 'lib/useHasNetworkKeysSet';
3432import { InviteForm } from './InviteForm';
3533
@@ -48,13 +46,21 @@ export default function Point() {
4846 setInvites,
4947 } = useRollerStore();
5048 const networkKeysSet = useHasNetworkKeysSet();
49+ const [seenMissingKeys, setSeenMissingKeys] = useSeenMissingKeys();
5150 const [showModal, setShowModal] = useState(false);
52− const [seenMissingKeys, setSeeingMissingKeys] = useSeenMissingKeys();
5351 const [hideMessage, setHideMessage] = useState(false);
5452
53+ const hideModal = useCallback(() => {
54+ if (hideMessage) {
55+ setSeenMissingKeys(true);
56+ }
57+
58+ setShowModal(false);
59+ }, [hideMessage, setShowModal, setSeenMissingKeys]);
60+
5561 useEffect(() => {
56− setShowModal(!networkKeysSet);
57− }, [networkKeysSet]);
62+ setShowModal(!networkKeysSet && !seenMissingKeys);
63+ }, [networkKeysSet, seenMissingKeys]);
5864
5965 const loadL1Info = useCallback(async () => {
6066 await syncExtras(point);
@@ -84,7 +90,7 @@ export default function Point() {
8490 setInvites([]);
8591 }, []); // eslint-disable-line react-hooks/exhaustive-deps
8692
87− const { isParent, canManage, canSpawn, canVote } = useCurrentPermissions();
93+ const { isParent, canManage } = useCurrentPermissions();
8894
8995 // L1 invites
9096 const l1Invites = useInvites(point);
@@ -104,46 +110,22 @@ export default function Point() {
104110
105111 const loadedInvites = Just.hasInstance(availableInvites);
106112
107− const goSenate = useCallback(() => push(names.SENATE), [push, names]);
108−
109113 const goCohort = useCallback(() => push(names.INVITE_COHORT), [push, names]);
110114
111115 const goUrbitOS = useCallback(() => {
112− if (hideMessage) setSeeingMissingKeys(hideMessage);
116+ if (hideMessage) setSeenMissingKeys(hideMessage);
113117
114118 push(names.URBIT_OS);
115− }, [push, names, hideMessage, setSeeingMissingKeys]);
119+ }, [push, names, hideMessage, setSeenMissingKeys]);
116120
117121 const goUrbitID = useCallback(() => push(names.URBIT_ID), [push, names]);
118122
119123 const goResidents = useCallback(() => push(names.RESIDENTS), [push, names]);
120124
121− const goIssuePoint = useCallback(() => push(names.ISSUE_CHILD), [
122− names.ISSUE_CHILD,
123− push,
124− ]);
125−
126125 const planet = isPlanet(point);
127126
128127 const [showInviteForm, setShowInviteForm] = useState(false);
129128
130− const senateButton = (() => {
131− if (azimuth.getPointSize(point) !== azimuth.PointSize.Galaxy) {
132− return null;
133− }
134− return (
135− <>
136− <Grid.Item
137− full
138− as={ForwardButton}
139− disabled={!canVote}
140− onClick={goSenate}>
141− Senate
142− </Grid.Item>
143− <Grid.Divider />
144− </>
145− );
146− })();
147129 const address = need.addressFromWallet(wallet);
148130 const spawnedPending = pendingTransactions.filter(
149131 ({ rawTx }) => rawTx?.tx?.type === 'spawn'
@@ -220,8 +202,12 @@ export default function Point() {
220202 {isParent && (
221203 <Grid.Item full as={Flex} justify="between">
222204 <Card
223− title="Residency"
224− subtitle="Manage peers that you service"
205+ title={`${isStar(point) ? 'Star' : 'Galaxy'} Ops`}
206+ subtitle={
207+ isStar(point)
208+ ? 'Manage planets you sponsor and spawn planets'
209+ : 'Manage stars you sponsor, spawn stars, and vote'
210+ }
225211 onClick={goResidents}
226212 />
227213 </Grid.Item>
@@ -263,25 +249,10 @@ export default function Point() {
263249 disabled={!canManage}
264250 />
265251 </Grid.Item>
266− {isParent && (
267− <>
268− <Grid.Item
269− full
270− as={ForwardButton}
271− disabled={!canSpawn}
272− onClick={goIssuePoint}>
273− Issue Point
274− </Grid.Item>
275− <Grid.Divider />
276− </>
277− )}
278− {senateButton}
279252 </Grid>
280− <Modal
281− show={showModal && !seenMissingKeys}
282− hide={() => setShowModal(false)}>
253+ <Modal show={showModal} hide={hideModal}>
283254 <Box className="network-keys-modal">
284− <Box className="close" onClick={() => setShowModal(false)}>
255+ <Box className="close" onClick={hideModal}>
285256 ×
286257 </Box>
287258 <Box className="title">No Network Keys Found</Box>
@@ -297,7 +268,7 @@ export default function Point() {
297268 <Box className="dont-show">Do not warn me again</Box>
298269 </Row>
299270 <Row className="buttons">
300− <Button className="cancel" onClick={() => setShowModal(false)}>
271+ <Button className="cancel" onClick={hideModal}>
301272 Cancel
302273 </Button>
303274 <Button className="migrate" onClick={goUrbitOS}>