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

Commit

Permalink
Fixes error in Transfer modal (mix between props and own property) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ngotchac authored and jacogr committed Dec 10, 2016
1 parent 4d25445 commit 5c555aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 2 additions & 4 deletions js/src/modals/Transfer/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ export default class TransferStore {
constructor (api, props) {
this.api = api;

const { account, balance, gasLimit, senders, onClose, newError, sendersBalances } = props;
const { account, balance, gasLimit, senders, newError, sendersBalances } = props;
this.account = account;
this.balance = balance;
this.onClose = onClose;
this.isWallet = account && account.wallet;
this.newError = newError;

Expand All @@ -136,8 +135,7 @@ export default class TransferStore {
this.stage -= 1;
}

@action onClose = () => {
this.onClose && this.onClose();
@action handleClose = () => {
this.stage = 0;
}

Expand Down
11 changes: 9 additions & 2 deletions js/src/modals/Transfer/transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class Transfer extends Component {
<Button
icon={ <ContentClear /> }
label='Cancel'
onClick={ this.store.onClose } />
onClick={ this.handleClose } />
);
const nextBtn = (
<Button
Expand All @@ -234,7 +234,7 @@ class Transfer extends Component {
<Button
icon={ <ActionDoneAll /> }
label='Close'
onClick={ this.store.onClose } />
onClick={ this.handleClose } />
);

switch (stage) {
Expand Down Expand Up @@ -264,6 +264,13 @@ class Transfer extends Component {
</div>
);
}

handleClose = () => {
const { onClose } = this.props;

this.store.handleClose();
typeof onClose === 'function' && onClose();
}
}

function mapStateToProps (initState, initProps) {
Expand Down

0 comments on commit 5c555aa

Please sign in to comment.