on master help sign in
Merge pull request #86 from urbit/back-button

Implement back navigation

commitee3c56d5a7ebb72a61074fc6b5f5fe481f0bf67f authorChristopher Johnson <chris@cjohnson.io> dateWed 27 Mar 2019, 14:08 (8 years ago) parent74051bab6372f6
2 files changed+7−1
src/Bridge.js+6 src/views/Network.js+1−1
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)