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) {
|
constructor (api, props) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
|
|
||||||
const { account, balance, gasLimit, senders, onClose, newError, sendersBalances } = props;
|
const { account, balance, gasLimit, senders, newError, sendersBalances } = props;
|
||||||
this.account = account;
|
this.account = account;
|
||||||
this.balance = balance;
|
this.balance = balance;
|
||||||
this.onClose = onClose;
|
|
||||||
this.isWallet = account && account.wallet;
|
this.isWallet = account && account.wallet;
|
||||||
this.newError = newError;
|
this.newError = newError;
|
||||||
|
|
||||||
@ -136,8 +135,7 @@ export default class TransferStore {
|
|||||||
this.stage -= 1;
|
this.stage -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@action onClose = () => {
|
@action handleClose = () => {
|
||||||
this.onClose && this.onClose();
|
|
||||||
this.stage = 0;
|
this.stage = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ class Transfer extends Component {
|
|||||||
<Button
|
<Button
|
||||||
icon={ <ContentClear /> }
|
icon={ <ContentClear /> }
|
||||||
label='Cancel'
|
label='Cancel'
|
||||||
onClick={ this.store.onClose } />
|
onClick={ this.handleClose } />
|
||||||
);
|
);
|
||||||
const nextBtn = (
|
const nextBtn = (
|
||||||
<Button
|
<Button
|
||||||
@ -234,7 +234,7 @@ class Transfer extends Component {
|
|||||||
<Button
|
<Button
|
||||||
icon={ <ActionDoneAll /> }
|
icon={ <ActionDoneAll /> }
|
||||||
label='Close'
|
label='Close'
|
||||||
onClick={ this.store.onClose } />
|
onClick={ this.handleClose } />
|
||||||
);
|
);
|
||||||
|
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
@ -264,6 +264,13 @@ class Transfer extends Component {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleClose = () => {
|
||||||
|
const { onClose } = this.props;
|
||||||
|
|
||||||
|
this.store.handleClose();
|
||||||
|
typeof onClose === 'function' && onClose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapStateToProps (initState, initProps) {
|
function mapStateToProps (initState, initProps) {
|
||||||
|
Loading…
Reference in New Issue
Block a user