Skip to content

Commit

Permalink
desktop#5 support redirect to public network when domain request is /…
Browse files Browse the repository at this point in the history
…/steexp.com but saved network is testnet
  • Loading branch information
chatch committed Jul 29, 2017
1 parent bb08332 commit d61a04a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,16 @@ class App extends Component {

componentWillMount() {
// handle direct to testnet links in the form testnet.steexp.com/*
if (isTestnetAddr() && this.state.network !== 'test')
this.networkSwitcher(NETWORK_TEST)
// and handle switch back to public when testnet is not in the domain
if (isTestnetAddr()) {
if (this.state.network !== NETWORK_TEST) {
this.networkSwitcher(NETWORK_TEST)
}
} else {
if (this.state.network !== NETWORK_PUBLIC) {
this.networkSwitcher(NETWORK_PUBLIC)
}
}
}

languageSwitcher = event => {
Expand Down

0 comments on commit d61a04a

Please sign in to comment.