mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #3433 from danjm/i3087-shapeshift-split-undefined
Shapeshift form handles 'market info unavailable' errors.
This commit is contained in:
commit
9762a73041
@ -4,7 +4,8 @@
|
|||||||
|
|
||||||
- Allow adding custom tokens to classic ui when balance is 0
|
- Allow adding custom tokens to classic ui when balance is 0
|
||||||
- Allow editing of symbol and decimal info when adding custom token in new-ui
|
- Allow editing of symbol and decimal info when adding custom token in new-ui
|
||||||
- NewUI shapeshift form can select all coins (not just BTC)
|
- new-ui shapeshift form can select all coins (not just BTC)
|
||||||
|
- Classic ui and new-ui shapeshift forms show when coins are not available on shapeshift
|
||||||
|
|
||||||
## 4.1.3 2018-2-28
|
## 4.1.3 2018-2-28
|
||||||
|
|
||||||
|
@ -1498,6 +1498,7 @@ function pairUpdate (coin) {
|
|||||||
dispatch(actions.hideWarning())
|
dispatch(actions.hideWarning())
|
||||||
shapeShiftRequest('marketinfo', {pair: `${coin.toLowerCase()}_eth`}, (mktResponse) => {
|
shapeShiftRequest('marketinfo', {pair: `${coin.toLowerCase()}_eth`}, (mktResponse) => {
|
||||||
dispatch(actions.hideSubLoadingIndication())
|
dispatch(actions.hideSubLoadingIndication())
|
||||||
|
if (mktResponse.error) return dispatch(actions.displayWarning(mktResponse.error))
|
||||||
dispatch({
|
dispatch({
|
||||||
type: actions.PAIR_UPDATE,
|
type: actions.PAIR_UPDATE,
|
||||||
value: {
|
value: {
|
||||||
|
@ -33,6 +33,9 @@ function mapDispatchToProps (dispatch) {
|
|||||||
hideModal: () => {
|
hideModal: () => {
|
||||||
dispatch(actions.hideModal())
|
dispatch(actions.hideModal())
|
||||||
},
|
},
|
||||||
|
hideWarning: () => {
|
||||||
|
dispatch(actions.hideWarning())
|
||||||
|
},
|
||||||
showAccountDetailModal: () => {
|
showAccountDetailModal: () => {
|
||||||
dispatch(actions.showModal({ name: 'ACCOUNT_DETAILS' }))
|
dispatch(actions.showModal({ name: 'ACCOUNT_DETAILS' }))
|
||||||
},
|
},
|
||||||
@ -119,6 +122,7 @@ DepositEtherModal.prototype.render = function () {
|
|||||||
h('div.deposit-ether-modal__header__close', {
|
h('div.deposit-ether-modal__header__close', {
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.setState({ buyingWithShapeshift: false })
|
this.setState({ buyingWithShapeshift: false })
|
||||||
|
this.props.hideWarning()
|
||||||
this.props.hideModal()
|
this.props.hideModal()
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@ -179,6 +183,7 @@ DepositEtherModal.prototype.render = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DepositEtherModal.prototype.goToAccountDetailsModal = function () {
|
DepositEtherModal.prototype.goToAccountDetailsModal = function () {
|
||||||
|
this.props.hideWarning()
|
||||||
this.props.hideModal()
|
this.props.hideModal()
|
||||||
this.props.showAccountDetailModal()
|
this.props.showAccountDetailModal()
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,7 @@ const MODALS = {
|
|||||||
contents: [
|
contents: [
|
||||||
h(DepositEtherModal, {}, []),
|
h(DepositEtherModal, {}, []),
|
||||||
],
|
],
|
||||||
|
onHide: (props) => props.hideWarning(),
|
||||||
mobileModalStyle: {
|
mobileModalStyle: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
@ -286,6 +287,10 @@ function mapDispatchToProps (dispatch) {
|
|||||||
hideModal: () => {
|
hideModal: () => {
|
||||||
dispatch(actions.hideModal())
|
dispatch(actions.hideModal())
|
||||||
},
|
},
|
||||||
|
hideWarning: () => {
|
||||||
|
dispatch(actions.hideWarning())
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,7 +313,12 @@ Modal.prototype.render = function () {
|
|||||||
{
|
{
|
||||||
className: 'modal',
|
className: 'modal',
|
||||||
keyboard: false,
|
keyboard: false,
|
||||||
onHide: () => { this.onHide() },
|
onHide: () => {
|
||||||
|
if (modal.onHide) {
|
||||||
|
modal.onHide(this.props)
|
||||||
|
}
|
||||||
|
this.onHide()
|
||||||
|
},
|
||||||
ref: (ref) => {
|
ref: (ref) => {
|
||||||
this.modalRef = ref
|
this.modalRef = ref
|
||||||
},
|
},
|
||||||
|
@ -14,11 +14,13 @@ function mapStateToProps (state) {
|
|||||||
tokenExchangeRates,
|
tokenExchangeRates,
|
||||||
selectedAddress,
|
selectedAddress,
|
||||||
} = state.metamask
|
} = state.metamask
|
||||||
|
const { warning } = state.appState
|
||||||
|
|
||||||
return {
|
return {
|
||||||
coinOptions,
|
coinOptions,
|
||||||
tokenExchangeRates,
|
tokenExchangeRates,
|
||||||
selectedAddress,
|
selectedAddress,
|
||||||
|
warning,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +165,7 @@ ShapeshiftForm.prototype.renderQrCode = function () {
|
|||||||
|
|
||||||
|
|
||||||
ShapeshiftForm.prototype.render = function () {
|
ShapeshiftForm.prototype.render = function () {
|
||||||
const { coinOptions, btnClass } = this.props
|
const { coinOptions, btnClass, warning } = this.props
|
||||||
const { depositCoin, errorMessage, showQrCode, depositAddress } = this.state
|
const { depositCoin, errorMessage, showQrCode, depositAddress } = this.state
|
||||||
const coinPair = `${depositCoin}_eth`
|
const coinPair = `${depositCoin}_eth`
|
||||||
const { tokenExchangeRates } = this.props
|
const { tokenExchangeRates } = this.props
|
||||||
@ -206,7 +208,9 @@ ShapeshiftForm.prototype.render = function () {
|
|||||||
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
h('div', {
|
warning && h('div.shapeshift-form__address-input-label', warning),
|
||||||
|
|
||||||
|
!warning && h('div', {
|
||||||
className: classnames('shapeshift-form__address-input-wrapper', {
|
className: classnames('shapeshift-form__address-input-wrapper', {
|
||||||
'shapeshift-form__address-input-wrapper--error': errorMessage,
|
'shapeshift-form__address-input-wrapper--error': errorMessage,
|
||||||
}),
|
}),
|
||||||
@ -227,7 +231,7 @@ ShapeshiftForm.prototype.render = function () {
|
|||||||
h('divshapeshift-form__address-input-error-message', [errorMessage]),
|
h('divshapeshift-form__address-input-error-message', [errorMessage]),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
this.renderMarketInfo(),
|
!warning && this.renderMarketInfo(),
|
||||||
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
@ -787,6 +787,10 @@
|
|||||||
width: auto;
|
width: auto;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 575px) {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user