on master help sign in
Merge pull request #1072 from urbit/pkova/actually-fix

NetworkKeys: actually fix stale keyfile download

commit398a47d36c25e5ac01c5e676acb8d06e66f65e2d authortomholford <16504501+tomholford@users.noreply.github.com> dateWed 9 Nov 2022, 06:53 (4 years ago) parentd72d3ca33aeea9
2 files changed+5−5
src/lib/useRoller.ts+2−1 src/views/UrbitOS/NetworkKeys.tsx+3−4
src/lib/useRoller.ts+2−1
@@ -213,7 +213,8 @@ export default function useRoller() {
213213 }: UpdateParams) => {
214214
215215
216− const p = (typeof point === 'number' ? await initPoint(point) : point) as Point
216+ const pVal = (typeof point === 'number' ? point : point.value);
217+ const p = await initPoint(pVal);
217218
218219 if (l1Txn) storePendingL1Txn(l1Txn);
219220
src/views/UrbitOS/NetworkKeys.tsx+3−4
@@ -47,13 +47,13 @@ import BodyPane from 'components/L2/Window/BodyPane';
4747
4848import './NetworkKeys.scss';
4949import { L1TxnType } from 'lib/types/PendingL1Transaction';
50+import { PointField } from 'lib/types/Point';
5051
5152function useSetKeys(
5253 manualNetworkSeed: string,
5354 setManualNetworkSeed: (seed: string) => void
5455) {
5556 const { urbitWallet, wallet, authMnemonic, authToken }: any = useWallet();
56− const { getAndUpdatePoint } = useRoller();
5757 const { point } = useRollerStore();
5858 const { syncDetails, syncRekeyDate }: any = usePointCache();
5959 const { contracts }: any = useNetwork();
@@ -127,9 +127,7 @@ function useSetKeys(
127127 [_contracts, point, buildNetworkSeed]
128128 ),
129129 useCallback(
130− () => Promise.all([getAndUpdatePoint(point.value),
131− syncDetails(point.value),
132− syncRekeyDate(point.value)]),
130+ () => Promise.all([syncDetails(point.value), syncRekeyDate(point.value)]),
133131 [point, syncDetails, syncRekeyDate]
134132 ),
135133 GAS_LIMITS.CONFIGURE_KEYS
@@ -180,6 +178,7 @@ export default function UrbitOSNetworkKeys({
180178 if (completed) {
181179 checkForUpdates({
182180 point: point,
181+ field: PointField.keyRevisionNumber,
183182 message: `${point.patp}'s Network Keys have been set!`,
184183 l1Txn: {
185184 id: `${point.keyRevisionNumber}-network-keys-${point.value}`,