Remove extraneous id hashing (#7269)

* Remove extraenous id hashing

* Update with latest js-shared
This commit is contained in:
Jaco Greeff
2017-12-12 12:09:24 +01:00
committed by GitHub
parent 11b0cb8da8
commit 777bce8a13
8 changed files with 26 additions and 72 deletions

View File

@@ -19,7 +19,6 @@ import { observer } from 'mobx-react';
import { FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';
import Api from '@parity/api';
import builtinDapps from '@parity/shared/lib/config/dappsBuiltin.json';
import viewsDapps from '@parity/shared/lib/config/dappsViews.json';
import DappsStore from '@parity/shared/lib/mobx/dappsStore';
@@ -27,15 +26,7 @@ import HistoryStore from '@parity/shared/lib/mobx/historyStore';
import styles from './dapp.css';
const internalDapps = []
.concat(viewsDapps, builtinDapps)
.map((app) => {
if (app.id && app.id.substr(0, 2) !== '0x') {
app.id = Api.util.sha3(app.id);
}
return app;
});
const internalDapps = [].concat(viewsDapps, builtinDapps);
@observer
export default class Dapp extends Component {
@@ -130,13 +121,9 @@ export default class Dapp extends Component {
dapphost = '';
}
const appId = this.context.api.util.isHex(app.id)
? app.id
: this.context.api.sha3(app.url);
src = window.location.protocol === 'file:'
? `dapps/${appId}/index.html`
: `${dapphost}/dapps/${appId}/index.html`;
? `dapps/${app.id}/index.html`
: `${dapphost}/dapps/${app.id}/index.html`;
break;
}