@@ -18,10 +18,11 @@ import {
1818import useCurrentPermissions from './useCurrentPermissions';
1919
2020export default function useKeyfileGenerator(manualNetworkSeed) {
21− const { getDetails } = usePointCache();
2221 const { urbitWallet, wallet, authMnemonic } = useWallet();
2322 const { pointCursor } = usePointCursor();
23+ const { getDetails } = usePointCache();
2424
25+ const [notice, setNotice] = useState('Deriving networking keys...');
2526 const [downloaded, setDownloaded] = useState(false);
2627 const [generating, setGenerating] = useState(true);
2728 const [keyfile, setKeyfile] = useState(false);
@@ -36,12 +37,13 @@ export default function useKeyfileGenerator(manualNetworkSeed) {
3637 const available =
3738 (isOwner || isManagementProxy) && hasNetworkingKeys && !!keyfile;
3839
39− console.log(
40− `keyfile available (${available}) for revision ${networkRevision}`
41− );
42−
4340 const generate = useCallback(async () => {
44− console.log('generating for network revision', networkRevision);
41+ console.log('attempting generation for network revision', networkRevision);
42+ if (!hasNetworkingKeys) {
43+ setGenerating(false);
44+ setNotice('Networking keys not yet set.');
45+ return;
46+ }
4547
4648 const networkSeed = manualNetworkSeed
4749 ? Just(manualNetworkSeed)
@@ -55,7 +57,9 @@ export default function useKeyfileGenerator(manualNetworkSeed) {
5557
5658 if (Nothing.hasInstance(networkSeed)) {
5759 setGenerating(false);
58− console.log('manual network seed not provided and key not derivable');
60+ setNotice(
61+ 'Custom or nondeterministic networking keys cannot be re-downloaded.'
62+ );
5963 return;
6064 }
6165
@@ -65,14 +69,16 @@ export default function useKeyfileGenerator(manualNetworkSeed) {
6569
6670 if (!keysMatchChain(pair, _details)) {
6771 setGenerating(false);
68− console.log('derived network keys do not match on-chain details');
72+ setNotice('Derived networking keys do not match on-chain details.');
6973 return;
7074 }
7175
76+ setNotice();
7277 setKeyfile(compileNetworkingKey(pair, _point, networkRevision));
7378 setGenerating(false);
7479 }, [
7580 networkRevision,
81+ hasNetworkingKeys,
7682 manualNetworkSeed,
7783 urbitWallet,
7884 wallet,
@@ -101,6 +107,7 @@ export default function useKeyfileGenerator(manualNetworkSeed) {
101107 available,
102108 downloaded,
103109 download,
110+ notice,
104111 };
105112
106113 return { ...values, bind: values };