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

Fix references to api outside of parity.js #4981

Merged
merged 1 commit into from
Mar 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -49,7 +50,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 @@ -16,8 +16,9 @@

import { URL_TYPE } from '../Inputs/validation';
import { getTokenTotalSupply, urlToHash } 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