Skip to content

Commit

Permalink
Merge pull request #1853 from MyCryptoHQ/hotfix-may-25
Browse files Browse the repository at this point in the history
Release 1.0.2
  • Loading branch information
dternyak authored May 25, 2018
2 parents 675d01a + 6ba78b8 commit e3f485e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 29 deletions.
12 changes: 8 additions & 4 deletions common/containers/Tabs/Contracts/components/Deploy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { DataFieldFactory } from 'components/DataFieldFactory';
import { SendButtonFactory } from 'components/SendButtonFactory';
import WalletDecrypt, { DISABLE_WALLETS } from 'components/WalletDecrypt';
import React, { Component } from 'react';
import { setToField, TSetToField } from 'actions/transaction';
import { resetTransactionRequested, TResetTransactionRequested } from 'actions/transaction';
import { resetWallet, TResetWallet } from 'actions/wallet';
import { connect } from 'react-redux';
import { FullWalletOnly } from 'components/renderCbs';
Expand All @@ -13,11 +13,15 @@ import { ConfirmationModal } from 'components/ConfirmationModal';
import { TextArea } from 'components/ui';

interface DispatchProps {
setToField: TSetToField;
resetWallet: TResetWallet;
resetTransactionRequested: TResetTransactionRequested;
}

class DeployClass extends Component<DispatchProps> {
public componentDidMount() {
this.props.resetTransactionRequested();
}

public render() {
const makeContent = () => (
<main className="Deploy Tab-content-pane" role="main">
Expand Down Expand Up @@ -93,6 +97,6 @@ class DeployClass extends Component<DispatchProps> {
}

export const Deploy = connect(null, {
setToField,
resetWallet
resetWallet,
resetTransactionRequested
})(DeployClass);
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ import { GenerateTransaction } from 'components/GenerateTransaction';
import { AppState } from 'reducers';
import { connect } from 'react-redux';
import { Fields } from './components';
import { setDataField, TSetDataField } from 'actions/transaction';
import {
setDataField,
resetTransactionRequested,
TSetDataField,
TResetTransactionRequested,
TSetAsContractInteraction,
TSetAsViewAndSend,
setAsContractInteraction,
setAsViewAndSend
} from 'actions/transaction';
import { Data } from 'libs/units';
import { Input, Dropdown } from 'components/ui';
import { INode } from 'libs/nodes';
Expand All @@ -23,6 +32,9 @@ interface StateProps {
interface DispatchProps {
showNotification: TShowNotification;
setDataField: TSetDataField;
resetTransactionRequested: TResetTransactionRequested;
setAsContractInteraction: TSetAsContractInteraction;
setAsViewAndSend: TSetAsViewAndSend;
}

interface OwnProps {
Expand Down Expand Up @@ -64,6 +76,15 @@ class InteractExplorerClass extends Component<Props, State> {
outputs: {}
};

public componentDidMount() {
this.props.setAsContractInteraction();
this.props.resetTransactionRequested();
}

public componentWillUnmount() {
this.props.setAsViewAndSend();
}

public render() {
const { inputs, outputs, selectedFunction } = this.state;
const contractFunctionsOptions = this.contractOptions();
Expand Down Expand Up @@ -296,5 +317,11 @@ export const InteractExplorer = connect(
to: getTo(state),
dataExists: getDataExists(state)
}),
{ showNotification, setDataField }
{
showNotification,
setDataField,
resetTransactionRequested,
setAsContractInteraction,
setAsViewAndSend
}
)(InteractExplorerClass);
23 changes: 2 additions & 21 deletions common/containers/Tabs/Contracts/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
import translate from 'translations';
import { Interact } from './components/Interact';
import { Deploy } from './components/Deploy';
import {
setAsContractInteraction,
TSetAsContractInteraction,
setAsViewAndSend,
TSetAsViewAndSend
} from 'actions/transaction';

import TabSection from 'containers/TabSection';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Switch, Route, Redirect, RouteComponentProps } from 'react-router';
import SubTabs from 'components/SubTabs';
import { RouteNotFound } from 'components/RouteNotFound';

interface DispatchProps {
setAsContractInteraction: TSetAsContractInteraction;
setAsViewAndSend: TSetAsViewAndSend;
}

const tabs = [
{
path: 'interact',
Expand All @@ -31,14 +19,7 @@ const tabs = [
}
];

class Contracts extends Component<DispatchProps & RouteComponentProps<{}>> {
public componentDidMount() {
this.props.setAsContractInteraction();
}
public componentWillUnmount() {
this.props.setAsViewAndSend();
}

class Contracts extends Component<RouteComponentProps<{}>> {
public render() {
const { match, location, history } = this.props;
const currentPath = match.url;
Expand All @@ -65,4 +46,4 @@ class Contracts extends Component<DispatchProps & RouteComponentProps<{}>> {
}
}

export default connect(null, { setAsContractInteraction, setAsViewAndSend })(Contracts);
export default connect(null, {})(Contracts);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "MyCrypto",
"author": "MyCryptoHQ",
"version": "1.0.1",
"electron-version": "1.0.1-alpha.4",
"version": "1.0.2",
"electron-version": "1.0.2-alpha.5",
"main": "main.js",
"description": "MyCrypto web and electron app",
"repository": "https://github.com/MyCryptoHQ/MyCrypto",
Expand Down

0 comments on commit e3f485e

Please sign in to comment.