@@ -17,6 +17,8 @@ import { TxnConfirmationsProvider } from './store/txnConfirmations';
1717import { OnlineProvider } from './store/online';
1818import { NetworkProvider } from './store/network';
1919import { WalletProvider } from './store/wallet';
20+import { PointCursorProvider } from './store/pointCursor';
21+import { PointCacheProvider } from './store/pointCache';
2022
2123const kInitialNetworkType = isDevelopment
2224 ? NETWORK_TYPES.LOCAL
@@ -45,6 +47,7 @@ const kInitialWallet = kIsStubbed
4547const kInitialMnemonic = kIsStubbed
4648 ? process.env.REACT_APP_DEV_MNEMONIC
4749 : Nothing();
50+const kInitialPointCursor = kIsStubbed ? Just(0) : Nothing();
4851
4952// the router itself is just a component that renders a specific view
5053// depending on the history
@@ -83,6 +86,8 @@ const AllProviders = nest([
8386 OnlineProvider,
8487 NetworkProvider,
8588 WalletProvider,
89+ PointCursorProvider,
90+ PointCacheProvider,
8691]);
8792
8893class Bridge extends React.Component {
@@ -91,30 +96,13 @@ class Bridge extends React.Component {
9196
9297 this.state = {
9398 networkSeedCache: null,
94− // point
95− pointCursor: Nothing(),
96− pointCache: {},
9799 // txn
98100 txnHashCursor: Nothing(),
99101 txnConfirmations: {},
100102 };
101103
102− this.setPointCursor = this.setPointCursor.bind(this);
103104 this.setTxnHashCursor = this.setTxnHashCursor.bind(this);
104105 this.setNetworkSeedCache = this.setNetworkSeedCache.bind(this);
105− this.addToPointCache = this.addToPointCache.bind(this);
106− }
107−
108− componentDidMount() {
109− // NB (jtobin, shrugs):
110− //
111− // If running in development, the following can be tweaked to get you set
112− // up with a desirable initial state.
113− if (kIsStubbed) {
114− this.setState({
115− pointCursor: Just(0),
116− });
117− }
118106 }
119107
120108 setNetworkSeedCache(networkSeed, revision) {
@@ -124,16 +112,6 @@ class Bridge extends React.Component {
124112 });
125113 }
126114
127− setPointCursor(pointCursor) {
128− this.setState({ pointCursor });
129− }
130−
131− addToPointCache(entry) {
132− this.setState((state, _) => ({
133− pointCache: Object.assign(state.pointCache, entry),
134− }));
135− }
136−
137115 setTxnHashCursor(txnHashCursor) {
138116 this.setState({ txnHashCursor });
139117 }
@@ -142,8 +120,6 @@ class Bridge extends React.Component {
142120 const {
143121 networkSeedCache,
144122 networkRevisionCache,
145− pointCursor,
146− pointCache,
147123 txnHashCursor,
148124 } = this.state;
149125
@@ -152,18 +128,15 @@ class Bridge extends React.Component {
152128 initialRoutes={kInitialRoutes}
153129 initialNetworkType={kInitialNetworkType}
154130 initialWallet={kInitialWallet}
155− initialMnemonic={kInitialMnemonic}>
131+ initialMnemonic={kInitialMnemonic}
132+ initialPointCursor={kInitialPointCursor}>
156133 <Container>
157134 <Row>
158135 <VariableWidthColumn>
159− <Header pointCursor={pointCursor} />
136+ <Header />
160137
161138 <Row className={'row wrapper'}>
162139 <Router
163− setPointCursor={this.setPointCursor}
164− addToPointCache={this.addToPointCache}
165− pointCursor={pointCursor}
166− pointCache={pointCache}
167140 networkSeedCache={networkSeedCache}
168141 networkRevisionCache={networkRevisionCache}
169142 setNetworkSeedCache={this.setNetworkSeedCache}