Fixes error in Transfer modal (mix between props and own property) (#3788)
This commit is contained in:
parent
4d25445af5
commit
5c555aa18f
@ -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;
|
||||
|
||||
@ -136,8 +135,7 @@ export default class TransferStore {
|
||||
this.stage -= 1;
|
||||
}
|
||||
|
||||
@action onClose = () => {
|
||||
this.onClose && this.onClose();
|
||||
@action handleClose = () => {
|
||||
this.stage = 0;
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ class Transfer extends Component {
|
||||
<Button
|
||||
icon={ <ContentClear /> }
|
||||
label='Cancel'
|
||||
onClick={ this.store.onClose } />
|
||||
onClick={ this.handleClose } />
|
||||
);
|
||||
const nextBtn = (
|
||||
<Button
|
||||
@ -234,7 +234,7 @@ class Transfer extends Component {
|
||||
<Button
|
||||
icon={ <ActionDoneAll /> }
|
||||
label='Close'
|
||||
onClick={ this.store.onClose } />
|
||||
onClick={ this.handleClose } />
|
||||
);
|
||||
|
||||
switch (stage) {
|
||||
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user