@@ -17,6 +17,7 @@ import { TxnConfirmationsProvider } from './store/txnConfirmations';
17import { OnlineProvider } from './store/online';
17import { OnlineProvider } from './store/online';
18import { NetworkProvider } from './store/network';
18import { NetworkProvider } from './store/network';
19import { WalletProvider } from './store/wallet';
19import { WalletProvider } from './store/wallet';
20+import { PointCursorProvider } from './store/pointCursor';
21const kInitialNetworkType = isDevelopment
22const kInitialNetworkType = isDevelopment
22 ? NETWORK_TYPES.LOCAL
23 ? NETWORK_TYPES.LOCAL
@@ -45,6 +46,7 @@ const kInitialWallet = kIsStubbed
45const kInitialMnemonic = kIsStubbed
46const kInitialMnemonic = kIsStubbed
46 ? process.env.REACT_APP_DEV_MNEMONIC
47 ? process.env.REACT_APP_DEV_MNEMONIC
47 : Nothing();
48 : Nothing();
49+const kInitialPointCursor = kIsStubbed ? Just(0) : Nothing();
49// the router itself is just a component that renders a specific view
51// the router itself is just a component that renders a specific view
50// depending on the history
52// depending on the history
@@ -83,6 +85,7 @@ const AllProviders = nest([
83 OnlineProvider,
85 OnlineProvider,
84 NetworkProvider,
86 NetworkProvider,
85 WalletProvider,
87 WalletProvider,
88class Bridge extends React.Component {
91class Bridge extends React.Component {
@@ -91,30 +94,13 @@ class Bridge extends React.Component {
92 this.state = {
95 this.state = {
93 networkSeedCache: null,
96 networkSeedCache: null,
95− pointCursor: Nothing(),
98 txnHashCursor: Nothing(),
98 txnHashCursor: Nothing(),
99 txnConfirmations: {},
99 txnConfirmations: {},
102− this.setPointCursor = this.setPointCursor.bind(this);
103 this.setTxnHashCursor = this.setTxnHashCursor.bind(this);
102 this.setTxnHashCursor = this.setTxnHashCursor.bind(this);
104 this.setNetworkSeedCache = this.setNetworkSeedCache.bind(this);
103 this.setNetworkSeedCache = this.setNetworkSeedCache.bind(this);
105− this.addToPointCache = this.addToPointCache.bind(this);
108− componentDidMount() {
109− // NB (jtobin, shrugs):
111− // If running in development, the following can be tweaked to get you set
112− // up with a desirable initial state.
115− pointCursor: Just(0),
120 setNetworkSeedCache(networkSeed, revision) {
106 setNetworkSeedCache(networkSeed, revision) {
@@ -124,16 +110,6 @@ class Bridge extends React.Component {
127− setPointCursor(pointCursor) {
128− this.setState({ pointCursor });
131− addToPointCache(entry) {
132− this.setState((state, _) => ({
133− pointCache: Object.assign(state.pointCache, entry),
137 setTxnHashCursor(txnHashCursor) {
113 setTxnHashCursor(txnHashCursor) {
138 this.setState({ txnHashCursor });
114 this.setState({ txnHashCursor });
@@ -142,8 +118,6 @@ class Bridge extends React.Component {
143 networkSeedCache,
119 networkSeedCache,
144 networkRevisionCache,
120 networkRevisionCache,
147 txnHashCursor,
121 txnHashCursor,
148 } = this.state;
122 } = this.state;
@@ -152,18 +126,15 @@ class Bridge extends React.Component {
152 initialRoutes={kInitialRoutes}
126 initialRoutes={kInitialRoutes}
153 initialNetworkType={kInitialNetworkType}
127 initialNetworkType={kInitialNetworkType}
154 initialWallet={kInitialWallet}
128 initialWallet={kInitialWallet}
155− initialMnemonic={kInitialMnemonic}>
129+ initialMnemonic={kInitialMnemonic}
130+ initialPointCursor={kInitialPointCursor}>
156 <Container>
131 <Container>
158 <VariableWidthColumn>
133 <VariableWidthColumn>
159− <Header pointCursor={pointCursor} />
134+ <Header />
161 <Row className={'row wrapper'}>
136 <Row className={'row wrapper'}>
163− setPointCursor={this.setPointCursor}
164− addToPointCache={this.addToPointCache}
165− pointCursor={pointCursor}
166− pointCache={pointCache}
167 networkSeedCache={networkSeedCache}
138 networkSeedCache={networkSeedCache}
168 networkRevisionCache={networkRevisionCache}
139 networkRevisionCache={networkRevisionCache}
169 setNetworkSeedCache={this.setNetworkSeedCache}
140 setNetworkSeedCache={this.setNetworkSeedCache}