@@ -1,4 +1,4 @@
1−import React, { useCallback, useMemo, useRef, useState } from 'react';
1+import React, { useCallback, useMemo, useRef } from 'react';
2import { Just } from 'folktale/maybe';
2import { Just } from 'folktale/maybe';
3import { Grid, ToggleInput, CheckboxInput } from 'indigo-react';
3import { Grid, ToggleInput, CheckboxInput } from 'indigo-react';
4import * as azimuth from 'azimuth-js';
4import * as azimuth from 'azimuth-js';
@@ -37,7 +37,7 @@ import Condition from 'form/Condition';
37import FormError from 'form/FormError';
37import FormError from 'form/FormError';
38import convertToInt from 'lib/convertToInt';
38import convertToInt from 'lib/convertToInt';
40−function useSetKeys() {
40+function useSetKeys(manualNetworkSeed, setManualNetworkSeed) {
41 const { urbitWallet, wallet, authMnemonic } = useWallet();
41 const { urbitWallet, wallet, authMnemonic } = useWallet();
42 const { pointCursor } = usePointCursor();
42 const { pointCursor } = usePointCursor();
43 const { syncDetails, syncRekeyDate, getDetails } = usePointCache();
43 const { syncDetails, syncRekeyDate, getDetails } = usePointCache();
@@ -50,19 +50,16 @@ function useSetKeys() {
50 const networkRevision = convertToInt(_details.keyRevisionNumber, 10);
50 const networkRevision = convertToInt(_details.keyRevisionNumber, 10);
51 const randomSeed = useRef();
51 const randomSeed = useRef();
53− // NOTE: nd = 'nondeterministic' (can also be a 'manual' seed)
54− const [ndNetworkSeed, setNdNetworkSeed] = useState();
57 available: keyfileAvailable,
54 available: keyfileAvailable,
59 bind: keyfileBind,
56 bind: keyfileBind,
60− } = useKeyfileGenerator(ndNetworkSeed);
57+ } = useKeyfileGenerator(manualNetworkSeed);
62 const buildNetworkSeed = useCallback(
59 const buildNetworkSeed = useCallback(
63 async manualSeed => {
60 async manualSeed => {
64 if (manualSeed !== undefined) {
61 if (manualSeed !== undefined) {
65− setNdNetworkSeed(manualSeed);
62+ setManualNetworkSeed(manualSeed);
66 return manualSeed;
63 return manualSeed;
68 const newNetworkRevision = networkRevision + 1;
65 const newNetworkRevision = networkRevision + 1;
@@ -81,12 +78,19 @@ function useSetKeys() {
83 randomSeed.current = randomSeed.current || randomHex(32); // 32 bytes
80 randomSeed.current = randomSeed.current || randomHex(32); // 32 bytes
84− setNdNetworkSeed(randomSeed.current);
81+ setManualNetworkSeed(randomSeed.current);
86 return randomSeed.current;
83 return randomSeed.current;
89− [_details, authMnemonic, networkRevision, urbitWallet, wallet]
89+ networkRevision,
90+ setManualNetworkSeed,
92 const { completed: _completed, ...rest } = useEthereumTransaction(
96 const { completed: _completed, ...rest } = useEthereumTransaction(
@@ -118,14 +122,16 @@ function useSetKeys() {
120 completed,
124 completed,
122 filename,
125 filename,
123 keyfileBind,
126 keyfileBind,
128−export default function UrbitOSNetworkingKeys() {
131+export default function UrbitOSNetworkingKeys({
133+ setManualNetworkSeed,
129 const { pop } = useLocalRouter();
135 const { pop } = useLocalRouter();
130 const { pointCursor } = usePointCursor();
136 const { pointCursor } = usePointCursor();
131 const { getDetails } = usePointCache();
137 const { getDetails } = usePointCache();
@@ -143,12 +149,11 @@ export default function UrbitOSNetworkingKeys() {
144 construct,
150 construct,
145 unconstruct,
151 unconstruct,
147 completed,
152 completed,
148 inputsLocked,
153 inputsLocked,
150 keyfileBind,
155 keyfileBind,
151− } = useSetKeys();
156+ } = useSetKeys(manualNetworkSeed, setManualNetworkSeed);
153 const validateForm = useCallback((values, errors) => {
158 const validateForm = useCallback((values, errors) => {
154 if (values.useNetworkSeed && errors.networkSeed) {
159 if (values.useNetworkSeed && errors.networkSeed) {
@@ -195,7 +200,8 @@ export default function UrbitOSNetworkingKeys() {
203+ const usageMessage =
198− const usageMessage = 'You need this to authenticate with arvo';
204+ 'You need this to authenticate with Arvo. Please download';