on master help sign in
store: rename syncKnownPoint to syncDates
d55748dfang
src/lib/useSyncPoints.js+3−3
@@ -16,9 +16,9 @@ const buildSyncHook = getFn =>
16 }, [fn, prevPoints, points]);
16 }, [fn, prevPoints, points]);
17 };
17 };
18
18
19−export const useSyncKnownPoints = buildSyncHook(function() {
19+export const useSyncDates = buildSyncHook(function() {
20− const { syncKnownPoint } = usePointCache();
20+ const { syncDates } = usePointCache();
21− return syncKnownPoint;
21+ return syncDates;
22});
22});
23
23
24export const useSyncDetails = buildSyncHook(function() {
24export const useSyncDetails = buildSyncHook(function() {
src/store/lib/usePointStore.js+5−6
@@ -20,8 +20,7 @@ export default function usePointStore() {
20 const { syncResidents, syncResidentCount, ...residents } = useResidents();
20 const { syncResidents, syncResidentCount, ...residents } = useResidents();
21 const ecliptic = useEclipticOwnerStore();
21 const ecliptic = useEclipticOwnerStore();
22
22
23− //TODO more appropriately named "syncDates" or similar
24− const syncKnownPoint = useCallback(
23+ const syncDates = useCallback(
25 async point => Promise.all([syncBirthday(point), syncRekeyDate(point)]),
24 async point => Promise.all([syncBirthday(point), syncRekeyDate(point)]),
26 [syncBirthday, syncRekeyDate]
25 [syncBirthday, syncRekeyDate]
27 );
26 );
@@ -29,13 +28,13 @@ export default function usePointStore() {
29 const syncExtras = useCallback(
28 const syncExtras = useCallback(
30 async point =>
29 async point =>
31 Promise.all([
30 Promise.all([
32− syncKnownPoint(point),
31+ syncDetails(point),
33 //
32 //
33+ syncDates(point),
34 syncResidentCount(point),
34 syncResidentCount(point),
35− syncDetails(point),
36 syncInvites(point),
35 syncInvites(point),
37 ]),
36 ]),
38− [syncKnownPoint, syncDetails, syncInvites, syncResidentCount]
37+ [syncDates, syncDetails, syncInvites, syncResidentCount]
39 );
38 );
40
39
41 return {
40 return {
@@ -50,7 +49,7 @@ export default function usePointStore() {
50 syncRekeyDate,
49 syncRekeyDate,
51 syncInvites,
50 syncInvites,
52 syncControlledPoints,
51 syncControlledPoints,
53− syncKnownPoint,
52+ syncDates,
54 syncResidents,
53 syncResidents,
55 syncExtras,
54 syncExtras,
56 };
55 };
src/views/Activate.js+2−4
@@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
2
2
3import useRouter from 'lib/useRouter';
3import useRouter from 'lib/useRouter';
4import { LocalRouterProvider } from 'lib/LocalRouter';
4import { LocalRouterProvider } from 'lib/LocalRouter';
5−import { useSyncKnownPoints } from 'lib/useSyncPoints';
5+import { useSyncDates } from 'lib/useSyncPoints';
6
6
7import { ActivateFlowProvider } from './Activate/ActivateFlow';
7import { ActivateFlowProvider } from './Activate/ActivateFlow';
8import useActivateFlowState from './Activate/useActivateFlowState';
8import useActivateFlowState from './Activate/useActivateFlowState';
@@ -38,9 +38,7 @@ export default function Activate() {
38 }, []);
38 }, []);
39
39
40 // when we know the derived point, ensure we have the data to display it
40 // when we know the derived point, ensure we have the data to display it
41− useSyncKnownPoints(
42− [state.derivedPoint.getOrElse(null)].filter(p => p !== null)
41+ useSyncDates([state.derivedPoint.getOrElse(null)].filter(p => p !== null));
43− );
44
42
45 return (
43 return (
46 <LocalRouterProvider value={router}>
44 <LocalRouterProvider value={router}>
src/views/CreateGalaxy.js+2−2
@@ -29,7 +29,7 @@ import CopiableAddress from 'components/CopiableAddress';
29
29
30function useCreateGalaxy() {
30function useCreateGalaxy() {
31 const { contracts } = useNetwork();
31 const { contracts } = useNetwork();
32− const { syncKnownPoint } = usePointCache();
32+ const { syncDates } = usePointCache();
33
33
34 const _contracts = need.contracts(contracts);
34 const _contracts = need.contracts(contracts);
35
35
@@ -43,7 +43,7 @@ function useCreateGalaxy() {
43 },
43 },
44 [_contracts]
44 [_contracts]
45 ),
45 ),
46− useCallback(() => syncKnownPoint(galaxy), [galaxy, syncKnownPoint]),
46+ useCallback(() => syncDates(galaxy), [galaxy, syncDates]),
47 GAS_LIMITS.DEFAULT
47 GAS_LIMITS.DEFAULT
48 );
48 );
49}
49}
src/views/IssueChild.js+2−5
@@ -34,7 +34,7 @@ import convertToInt from 'lib/convertToInt';
34
34
35function useIssueChild() {
35function useIssueChild() {
36 const { contracts } = useNetwork();
36 const { contracts } = useNetwork();
37− const { syncKnownPoint } = usePointCache();
37+ const { syncDates } = usePointCache();
38
38
39 const _contracts = need.contracts(contracts);
39 const _contracts = need.contracts(contracts);
40
40
@@ -48,10 +48,7 @@ function useIssueChild() {
48 },
48 },
49 [_contracts]
49 [_contracts]
50 ),
50 ),
51− useCallback(() => syncKnownPoint(spawnedPoint), [
51+ useCallback(() => syncDates(spawnedPoint), [spawnedPoint, syncDates]),
52− spawnedPoint,
53− syncKnownPoint,
54− ]),
55 GAS_LIMITS.DEFAULT
52 GAS_LIMITS.DEFAULT
56 );
53 );
57}
54}