Use ethcore_dappsPort when constructing URLs (#3139)
* Upon connect, retrieve the available api ports
* Update dapps to load from dappsPort
* Update dapps summary with dappsPort
* Allow proxy to use dappsPort
* Replace /api/ping with HEAD /
* Dynamic port for available apps
* Retrieve content images with dappsPort
* Fix /
* Transfer token dropdown image fix
* IdentityIcon loads images via contentHash
* Update apps fetch to cater for dev & prod
* DRY up 127.0.0.1:${dappsPort} with ${dappsUrl}
This commit is contained in:
@@ -17,8 +17,6 @@
|
||||
import { handleActions } from 'redux-actions';
|
||||
import { bytesToHex } from '../../api/util/format';
|
||||
|
||||
import { parityNode } from '../../environment';
|
||||
|
||||
const ZERO = '0x0000000000000000000000000000000000000000000000000000000000000000';
|
||||
|
||||
const initialState = {
|
||||
@@ -28,7 +26,7 @@ const initialState = {
|
||||
export function hashToImageUrl (hashArray) {
|
||||
const hash = hashArray ? bytesToHex(hashArray) : ZERO;
|
||||
|
||||
return hash === ZERO ? null : `${parityNode}/api/content/${hash.substr(2)}`;
|
||||
return hash === ZERO ? null : `/api/content/${hash.substr(2)}`;
|
||||
}
|
||||
|
||||
export default handleActions({
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
import { statusBlockNumber, statusCollection, statusLogs } from './statusActions';
|
||||
|
||||
import { parityNode } from '../../environment';
|
||||
|
||||
export default class Status {
|
||||
constructor (store, api) {
|
||||
this._api = api;
|
||||
@@ -65,7 +63,7 @@ export default class Status {
|
||||
setTimeout(this._pollPing, timeout);
|
||||
};
|
||||
|
||||
fetch(`${parityNode}/api/ping`, { method: 'GET' })
|
||||
fetch('/', { method: 'HEAD' })
|
||||
.then((response) => dispatch(!!response.ok))
|
||||
.catch(() => dispatch(false));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user