- Implement back navigation by spoofing forward state every time back button is pressed.
commitb6372f6a539610e94d88595468ea0a29322adf96
authorChris Johnson <chris@cjohnson.io>
dateFri 22 Mar 2019, 17:24 (8 years ago)
parent01a581c
src/Bridge.js+6
@@ -74,6 +74,12 @@ class Bridge extends React.Component {
7474 }
7575
7676 componentDidMount() {
77+ window.history.pushState(null, null, null);
78+
79+ window.onpopstate = (e) => {
80+ window.history.pushState(null, null, null);
81+ this.popRoute();
82+ }
7783
7884 // NB (jtobin):
7985 //
src/views/Network.js+1−1
@@ -45,7 +45,7 @@ class Network extends React.Component {
4545 if (network === NETWORK_NAMES.LOCAL) {
4646 setNetworkType(network)
4747
48− const endpoint = 'wss://localhost:8545'
48+ const endpoint = 'ws://localhost:8545'
4949 const provider = new Web3.providers.WebsocketProvider(endpoint)
5050 const web3 = new Web3(provider)
5151 const contracts = azimuth.initContracts(web3, CONTRACT_ADDRESSES.DEV)