consolidate DEFAULT_HOST logic
This commit is contained in:
parent
9533b57627
commit
10fa3fec9f
|
@ -5,5 +5,5 @@ export const LIGHT_THEME = 'light';
|
||||||
export const DEPLOYMENT_PIPELINES = {
|
export const DEPLOYMENT_PIPELINES = {
|
||||||
injectedWeb3: 'injectedWeb3',
|
injectedWeb3: 'injectedWeb3',
|
||||||
embark: 'embark'
|
embark: 'embark'
|
||||||
}
|
};
|
||||||
export const DEFAULT_HOST = 'localhost:8000';
|
export const DEFAULT_HOST = process.env.NODE_ENV === 'development' ? 'localhost:8000' : window.location.host;
|
||||||
|
|
|
@ -34,7 +34,7 @@ class AppContainer extends Component {
|
||||||
if (!token) {
|
if (!token) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const host = process.env.NODE_ENV === 'development' ? DEFAULT_HOST : window.location.host;
|
const host = DEFAULT_HOST;
|
||||||
if (token === this.props.credentials.token && this.props.credentials.host === host) {
|
if (token === this.props.credentials.token && this.props.credentials.host === host) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,7 +201,7 @@ function compilingContract(state = false, action) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_CREDENTIALS_STATE = {
|
const DEFAULT_CREDENTIALS_STATE = {
|
||||||
host: process.env.NODE_ENV === 'development' ? DEFAULT_HOST : window.location.host,
|
host: DEFAULT_HOST,
|
||||||
token: '',
|
token: '',
|
||||||
authenticated: false,
|
authenticated: false,
|
||||||
authenticating: false,
|
authenticating: false,
|
||||||
|
|
Loading…
Reference in New Issue