@@ -17,6 +17,7 @@ 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';
2021
2122const kInitialNetworkType = isDevelopment
2223 ? NETWORK_TYPES.LOCAL
@@ -45,6 +46,7 @@ const kInitialWallet = kIsStubbed
4546const kInitialMnemonic = kIsStubbed
4647 ? process.env.REACT_APP_DEV_MNEMONIC
4748 : Nothing();
49+const kInitialPointCursor = kIsStubbed ? Just(0) : Nothing();
4850
4951// the router itself is just a component that renders a specific view
5052// depending on the history
@@ -83,6 +85,7 @@ const AllProviders = nest([
8385 OnlineProvider,
8486 NetworkProvider,
8587 WalletProvider,
88+ PointCursorProvider,
8689]);
8790
8891class Bridge extends React.Component {
@@ -91,30 +94,13 @@ class Bridge extends React.Component {
9194
9295 this.state = {
9396 networkSeedCache: null,
94− // point
95− pointCursor: Nothing(),
96− pointCache: {},
9797 // txn
9898 txnHashCursor: Nothing(),
9999 txnConfirmations: {},
100100 };
101101
102− this.setPointCursor = this.setPointCursor.bind(this);
103102 this.setTxnHashCursor = this.setTxnHashCursor.bind(this);
104103 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− }
118104 }
119105
120106 setNetworkSeedCache(networkSeed, revision) {
@@ -124,16 +110,6 @@ class Bridge extends React.Component {
124110 });
125111 }
126112
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−
137113 setTxnHashCursor(txnHashCursor) {
138114 this.setState({ txnHashCursor });
139115 }
@@ -142,8 +118,6 @@ class Bridge extends React.Component {
142118 const {
143119 networkSeedCache,
144120 networkRevisionCache,
145− pointCursor,
146− pointCache,
147121 txnHashCursor,
148122 } = this.state;
149123
@@ -152,18 +126,15 @@ class Bridge extends React.Component {
152126 initialRoutes={kInitialRoutes}
153127 initialNetworkType={kInitialNetworkType}
154128 initialWallet={kInitialWallet}
155− initialMnemonic={kInitialMnemonic}>
129+ initialMnemonic={kInitialMnemonic}
130+ initialPointCursor={kInitialPointCursor}>
156131 <Container>
157132 <Row>
158133 <VariableWidthColumn>
159− <Header pointCursor={pointCursor} />
134+ <Header />
160135
161136 <Row className={'row wrapper'}>
162137 <Router
163− setPointCursor={this.setPointCursor}
164− addToPointCache={this.addToPointCache}
165− pointCursor={pointCursor}
166− pointCache={pointCache}
167138 networkSeedCache={networkSeedCache}
168139 networkRevisionCache={networkRevisionCache}
169140 setNetworkSeedCache={this.setNetworkSeedCache}