Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Fix references to api outside of parity.js (#4981)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngotchac authored and 5chdn committed Apr 18, 2017
1 parent 6274959 commit a099f54
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions js/src/dapps/registry/Application/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import CircularProgress from 'material-ui/CircularProgress';
import { Card, CardText } from 'material-ui/Card';

import { nullableProptype } from '~/util/proptypes';
import { api } from '../parity';

import styles from './application.css';
import Accounts from '../Accounts';
Expand All @@ -39,7 +40,7 @@ export default class Application extends Component {
};

getChildContext () {
return { muiTheme, api: window.parity.api };
return { muiTheme, api };
}

static propTypes = {
Expand All @@ -53,7 +54,6 @@ export default class Application extends Component {
};

render () {
const { api } = window.parity;
const { contract, fee } = this.props;
let warning = null;

Expand Down
2 changes: 1 addition & 1 deletion js/src/dapps/tokenreg/Accounts/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

const { api } = window.parity;
import { api } from '../parity';

export const SET_ACCOUNTS = 'SET_ACCOUNTS';
export const setAccounts = (accounts) => ({
Expand Down
3 changes: 1 addition & 2 deletions js/src/dapps/tokenreg/Status/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
import Contracts from '~/contracts';

import { loadToken, setTokenPending, deleteToken, setTokenData } from '../Tokens/actions';

const { api } = window.parity;
import { api } from '../parity';

export const SET_LOADING = 'SET_LOADING';
export const setLoading = (isLoading) => ({
Expand Down
3 changes: 1 addition & 2 deletions js/src/dapps/tokenreg/Status/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@

import React, { Component, PropTypes } from 'react';

import { api } from '../parity';
import Chip from '../Chip';

import styles from './status.css';

const { api } = window.parity;

export default class Status extends Component {
static propTypes = {
address: PropTypes.string.isRequired,
Expand Down
3 changes: 2 additions & 1 deletion js/src/dapps/tokenreg/Tokens/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import { getTokenTotalSupply } from '../utils';
import { api } from '../parity';

const { bytesToHex } = window.parity.api.util;
const { bytesToHex } = api.util;

export const SET_TOKENS_LOADING = 'SET_TOKENS_LOADING';
export const setTokensLoading = (isLoading) => ({
Expand Down

0 comments on commit a099f54

Please sign in to comment.