on master help sign in
- Implement back navigation by spoofing forward state every time back button is pressed.
b6372f6Chris Johnson
src/Bridge.js+6
@@ -74,6 +74,12 @@ class Bridge extends React.Component {
74 }
74 }
75
75
76 componentDidMount() {
76 componentDidMount() {
77+ window.history.pushState(null, null, null);
78+
79+ window.onpopstate = (e) => {
80+ window.history.pushState(null, null, null);
81+ this.popRoute();
82+ }
77
83
78 // NB (jtobin):
84 // NB (jtobin):
79 //
85 //
src/views/Network.js+1−1
@@ -45,7 +45,7 @@ class Network extends React.Component {
45 if (network === NETWORK_NAMES.LOCAL) {
45 if (network === NETWORK_NAMES.LOCAL) {
46 setNetworkType(network)
46 setNetworkType(network)
47
47
48− const endpoint = 'wss://localhost:8545'
48+ const endpoint = 'ws://localhost:8545'
49 const provider = new Web3.providers.WebsocketProvider(endpoint)
49 const provider = new Web3.providers.WebsocketProvider(endpoint)
50 const web3 = new Web3(provider)
50 const web3 = new Web3(provider)
51 const contracts = azimuth.initContracts(web3, CONTRACT_ADDRESSES.DEV)
51 const contracts = azimuth.initContracts(web3, CONTRACT_ADDRESSES.DEV)