@@ -12,6 +12,8 @@ import { ForwardButton } from 'components/Buttons';
1212import NetworkingKeys from 'components/NetworkingKeys';
1313
1414import { useLocalRouter } from 'lib/LocalRouter';
15+import { PointDetails } from 'types/pointDetailsType';
16+import WarningBox from 'components/WarningBox';
1517
1618export default function UrbitOSHome({ manualNetworkSeed }) {
1719 const { pointCursor } = usePointCursor();
@@ -20,7 +22,7 @@ export default function UrbitOSHome({ manualNetworkSeed }) {
2022 const { push, names } = useLocalRouter();
2123
2224 const point = need.point(pointCursor);
23− const details = need.details(getDetails(point));
25+ const details: PointDetails = need.details(getDetails(point));
2426
2527 const sponsor = ob.patp(details.sponsor);
2628
@@ -29,6 +31,10 @@ export default function UrbitOSHome({ manualNetworkSeed }) {
2931 const showSponsor = azimuth.getPointSize(point) !== azimuth.PointSize.Galaxy;
3032 const toggleShowKeys = useCallback(() => setShowKeys(s => !s), [setShowKeys]);
3133
34+ // The initial key revision number is 0, and increments when set
35+ const hasSetNetworkingKeys = details.keyRevisionNumber !== '0';
36+ const networkKeysAction = hasSetNetworkingKeys ? 'Reset' : 'Initiate';
37+
3238 const goNetworkingKeys = useCallback(() => push(names.NETWORKING_KEYS), [
3339 names,
3440 push,
@@ -61,17 +67,26 @@ export default function UrbitOSHome({ manualNetworkSeed }) {
6167
6268 <Grid.Divider />
6369 <Grid.Item full as={ForwardButton} onClick={goNetworkingKeys}>
64− Reset Networking Keys
65− </Grid.Item>
66− <Grid.Divider />
67− <Grid.Item
68− full
69− as={ForwardButton}
70− accessory={showKeys ? '▼' : '▲'}
71− onClick={toggleShowKeys}>
72− View Networking Keys
70+ {networkKeysAction} Networking Keys
7371 </Grid.Item>
74− {showKeys && <Grid.Item full as={NetworkingKeys} point={point} />}
72+ {hasSetNetworkingKeys && (
73+ <>
74+ <Grid.Divider />
75+ <Grid.Item
76+ full
77+ as={ForwardButton}
78+ accessory={showKeys ? '▼' : '▲'}
79+ onClick={toggleShowKeys}>
80+ View Networking Keys
81+ </Grid.Item>
82+ {showKeys && <Grid.Item full as={NetworkingKeys} point={point} />}
83+ </>
84+ )}
85+ {!hasSetNetworkingKeys && (
86+ <Grid.Item full as={WarningBox} className="mt4">
87+ Networking Keys are required to generate a keyfile
88+ </Grid.Item>
89+ )}
7590 </Grid>
7691 </>
7792 );