on master help sign in
fix: additional race condition cases
2268655tomholford
src/store/pointCache.jsx+1
@@ -18,6 +18,7 @@ const initialContext = {
18 controlledPoints: Just(Result.Error('not yet loaded')),
18 controlledPoints: Just(Result.Error('not yet loaded')),
19 ecliptic: Nothing(),
19 ecliptic: Nothing(),
20 residents: Nothing(),
20 residents: Nothing(),
21+ pointCursor: Nothing(),
21 syncDetails: noop,
22 syncDetails: noop,
22 syncEclipticOwner:noop,
23 syncEclipticOwner:noop,
23 syncRekeyDate: noop,
24 syncRekeyDate: noop,
src/store/pointCursor.jsx+7−1
@@ -7,8 +7,14 @@ import React, {
7} from 'react';
7} from 'react';
8import { Nothing } from 'folktale/maybe';
8import { Nothing } from 'folktale/maybe';
9import { useRollerStore } from './rollerStore';
9import { useRollerStore } from './rollerStore';
10+import { noop } from 'lodash';
10
11
12+const initialContext = {
13+ pointCursor: Nothing(),
14+ setPointCursor: noop,
15+}
16+
11−export const PointCursorContext = createContext(null);
17+export const PointCursorContext = createContext(initialContext);
12
18
13// pointCursor is Maybe<number>
19// pointCursor is Maybe<number>
14function _usePointCursor(initialPointCursor = Nothing()) {
20function _usePointCursor(initialPointCursor = Nothing()) {
src/store/wallet.jsx+34−2
@@ -7,7 +7,7 @@ import React, {
7 useEffect,
7 useEffect,
8} from 'react';
8} from 'react';
9import { Just, Nothing } from 'folktale/maybe';
9import { Just, Nothing } from 'folktale/maybe';
10−import { includes } from 'lodash';
10+import { includes, noop } from 'lodash';
11import { randomHex } from 'web3-utils';
11import { randomHex } from 'web3-utils';
12
12
13import { walletFromMnemonic } from 'lib/wallet';
13import { walletFromMnemonic } from 'lib/wallet';
@@ -22,7 +22,39 @@ import { BRIDGE_ERROR } from 'lib/error';
22import { useNetwork } from 'store/network';
22import { useNetwork } from 'store/network';
23import { publicToAddress } from 'lib/utils/address';
23import { publicToAddress } from 'lib/utils/address';
24
24
25+const initialContext = {
26+ //
27+ walletType: Nothing(),
28+ setWalletType: noop,
29+ //
30+ walletHdPath: '',
31+ setWalletHdPath: noop,
32+ //
33+ wallet: Nothing(),
34+ setWallet: noop,
35+ //
36+ urbitWallet: Nothing(),
37+ setUrbitWallet: noop,
38+ authMnemonic: Nothing(),
39+ setAuthMnemonic: noop,
40+ //
41+ networkSeed: Nothing(),
42+ setNetworkSeed: noop,
43+ networkRevision: Nothing(),
44+ setNetworkRevision: noop,
45+ //
46+ resetWallet: noop,
47+ //
48+ authToken: Nothing(),
49+ setAuthToken: noop,
50+ useLegacyTokenSigning: Nothing(),
51+ setUseLegacyTokenSigning: noop,
52+ skipLoginSigning: false,
53+ setSkipLoginSigning: noop,
54+ setFakeToken: noop,
55+}
56+
25−export const WalletContext = createContext(null);
57+export const WalletContext = createContext(initialContext);
26
58
27const DEFAULT_WALLET_TYPE = WALLET_TYPES.TICKET;
59const DEFAULT_WALLET_TYPE = WALLET_TYPES.TICKET;
28
60