mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge branch 'master' into ImportAccountMessageV2
This commit is contained in:
commit
6a9ca29244
@ -8,6 +8,11 @@
|
||||
- Allow editing of symbol and decimal info when adding custom token in new-ui
|
||||
- NewUI shapeshift form can select all coins (not just BTC)
|
||||
- Add most of Microsoft Edge support.
|
||||
- Replace "Unlock" wording with "Log In".
|
||||
- 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
|
||||
- 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
|
||||
|
||||
|
@ -7,12 +7,13 @@ const changelogPath = path.join(__dirname, '..', 'CHANGELOG.md')
|
||||
const manifestPath = path.join(__dirname, '..', 'app', 'manifest.json')
|
||||
const manifest = require('../app/manifest.json')
|
||||
const versionBump = require('./version-bump')
|
||||
|
||||
const bumpType = normalizeType(process.argv[2])
|
||||
|
||||
start().catch(console.error)
|
||||
|
||||
readFile(changelogPath)
|
||||
.then(async (changeBuffer) => {
|
||||
async function start() {
|
||||
|
||||
const changeBuffer = await readFile(changelogPath)
|
||||
const changelog = changeBuffer.toString()
|
||||
|
||||
const newData = await versionBump(bumpType, changelog, manifest)
|
||||
@ -22,10 +23,8 @@ readFile(changelogPath)
|
||||
await writeFile(changelogPath, newData.changelog)
|
||||
await writeFile(manifestPath, manifestString)
|
||||
|
||||
return newData.version
|
||||
})
|
||||
.then((version) => console.log(`Bumped ${bumpType} to version ${version}`))
|
||||
.catch(console.error)
|
||||
console.log(`Bumped ${bumpType} to version ${newData.version}`)
|
||||
}
|
||||
|
||||
|
||||
function normalizeType (userInput) {
|
||||
|
@ -63,7 +63,7 @@ InfoScreen.prototype.render = function () {
|
||||
h('a', {
|
||||
href: 'https://metamask.io/privacy.html',
|
||||
target: '_blank',
|
||||
onClick (event) { this.navigateTo(event.target.href) },
|
||||
onClick: (event) => { this.navigateTo(event.target.href) },
|
||||
}, [
|
||||
h('div.info', 'Privacy Policy'),
|
||||
]),
|
||||
@ -72,7 +72,7 @@ InfoScreen.prototype.render = function () {
|
||||
h('a', {
|
||||
href: 'https://metamask.io/terms.html',
|
||||
target: '_blank',
|
||||
onClick (event) { this.navigateTo(event.target.href) },
|
||||
onClick: (event) => { this.navigateTo(event.target.href) },
|
||||
}, [
|
||||
h('div.info', 'Terms of Use'),
|
||||
]),
|
||||
@ -81,7 +81,7 @@ InfoScreen.prototype.render = function () {
|
||||
h('a', {
|
||||
href: 'https://metamask.io/attributions.html',
|
||||
target: '_blank',
|
||||
onClick (event) { this.navigateTo(event.target.href) },
|
||||
onClick: (event) => { this.navigateTo(event.target.href) },
|
||||
}, [
|
||||
h('div.info', 'Attributions'),
|
||||
]),
|
||||
|
@ -69,7 +69,7 @@ UnlockScreen.prototype.render = function () {
|
||||
style: {
|
||||
margin: 10,
|
||||
},
|
||||
}, 'Unlock'),
|
||||
}, 'Log In'),
|
||||
]),
|
||||
|
||||
h('.flex-row.flex-center.flex-grow', [
|
||||
|
@ -1498,6 +1498,7 @@ function pairUpdate (coin) {
|
||||
dispatch(actions.hideWarning())
|
||||
shapeShiftRequest('marketinfo', {pair: `${coin.toLowerCase()}_eth`}, (mktResponse) => {
|
||||
dispatch(actions.hideSubLoadingIndication())
|
||||
if (mktResponse.error) return dispatch(actions.displayWarning(mktResponse.error))
|
||||
dispatch({
|
||||
type: actions.PAIR_UPDATE,
|
||||
value: {
|
||||
|
@ -52,7 +52,7 @@ function AddTokenScreen () {
|
||||
isShowingConfirmation: false,
|
||||
customAddress: '',
|
||||
customSymbol: '',
|
||||
customDecimals: null,
|
||||
customDecimals: '',
|
||||
searchQuery: '',
|
||||
isCollapsed: true,
|
||||
selectedTokens: {},
|
||||
|
@ -33,6 +33,9 @@ function mapDispatchToProps (dispatch) {
|
||||
hideModal: () => {
|
||||
dispatch(actions.hideModal())
|
||||
},
|
||||
hideWarning: () => {
|
||||
dispatch(actions.hideWarning())
|
||||
},
|
||||
showAccountDetailModal: () => {
|
||||
dispatch(actions.showModal({ name: 'ACCOUNT_DETAILS' }))
|
||||
},
|
||||
@ -119,6 +122,7 @@ DepositEtherModal.prototype.render = function () {
|
||||
h('div.deposit-ether-modal__header__close', {
|
||||
onClick: () => {
|
||||
this.setState({ buyingWithShapeshift: false })
|
||||
this.props.hideWarning()
|
||||
this.props.hideModal()
|
||||
},
|
||||
}),
|
||||
@ -179,6 +183,7 @@ DepositEtherModal.prototype.render = function () {
|
||||
}
|
||||
|
||||
DepositEtherModal.prototype.goToAccountDetailsModal = function () {
|
||||
this.props.hideWarning()
|
||||
this.props.hideModal()
|
||||
this.props.showAccountDetailModal()
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ const MODALS = {
|
||||
contents: [
|
||||
h(DepositEtherModal, {}, []),
|
||||
],
|
||||
onHide: (props) => props.hideWarning(),
|
||||
mobileModalStyle: {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
@ -286,6 +287,10 @@ function mapDispatchToProps (dispatch) {
|
||||
hideModal: () => {
|
||||
dispatch(actions.hideModal())
|
||||
},
|
||||
hideWarning: () => {
|
||||
dispatch(actions.hideWarning())
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -308,7 +313,12 @@ Modal.prototype.render = function () {
|
||||
{
|
||||
className: 'modal',
|
||||
keyboard: false,
|
||||
onHide: () => { this.onHide() },
|
||||
onHide: () => {
|
||||
if (modal.onHide) {
|
||||
modal.onHide(this.props)
|
||||
}
|
||||
this.onHide()
|
||||
},
|
||||
ref: (ref) => {
|
||||
this.modalRef = ref
|
||||
},
|
||||
|
@ -14,11 +14,13 @@ function mapStateToProps (state) {
|
||||
tokenExchangeRates,
|
||||
selectedAddress,
|
||||
} = state.metamask
|
||||
const { warning } = state.appState
|
||||
|
||||
return {
|
||||
coinOptions,
|
||||
tokenExchangeRates,
|
||||
selectedAddress,
|
||||
warning,
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,7 +165,7 @@ ShapeshiftForm.prototype.renderQrCode = function () {
|
||||
|
||||
|
||||
ShapeshiftForm.prototype.render = function () {
|
||||
const { coinOptions, btnClass } = this.props
|
||||
const { coinOptions, btnClass, warning } = this.props
|
||||
const { depositCoin, errorMessage, showQrCode, depositAddress } = this.state
|
||||
const coinPair = `${depositCoin}_eth`
|
||||
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', {
|
||||
'shapeshift-form__address-input-wrapper--error': errorMessage,
|
||||
}),
|
||||
@ -227,7 +231,7 @@ ShapeshiftForm.prototype.render = function () {
|
||||
h('divshapeshift-form__address-input-error-message', [errorMessage]),
|
||||
]),
|
||||
|
||||
this.renderMarketInfo(),
|
||||
!warning && this.renderMarketInfo(),
|
||||
|
||||
]),
|
||||
|
||||
|
@ -787,6 +787,10 @@
|
||||
width: auto;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 575px) {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -361,8 +361,9 @@ SendTransactionScreen.prototype.validateAmount = function (value) {
|
||||
})
|
||||
}
|
||||
|
||||
const verifyTokenBalance = selectedToken && tokenBalance !== null
|
||||
let sufficientTokens
|
||||
if (selectedToken) {
|
||||
if (verifyTokenBalance) {
|
||||
sufficientTokens = isTokenBalanceSufficient({
|
||||
tokenBalance,
|
||||
amount,
|
||||
@ -377,7 +378,7 @@ SendTransactionScreen.prototype.validateAmount = function (value) {
|
||||
|
||||
if (conversionRate && !sufficientBalance) {
|
||||
amountError = 'Insufficient funds.'
|
||||
} else if (selectedToken && !sufficientTokens) {
|
||||
} else if (verifyTokenBalance && !sufficientTokens) {
|
||||
amountError = 'Insufficient tokens.'
|
||||
} else if (amountLessThanZero) {
|
||||
amountError = 'Can not send negative amounts of ETH.'
|
||||
@ -396,14 +397,15 @@ SendTransactionScreen.prototype.renderAmountRow = function () {
|
||||
amount,
|
||||
setMaxModeTo,
|
||||
maxModeOn,
|
||||
gasTotal,
|
||||
} = this.props
|
||||
|
||||
return h('div.send-v2__form-row', [
|
||||
|
||||
h('div.send-v2__form-label', [
|
||||
h('div.send-v2__form-label', [
|
||||
'Amount:',
|
||||
this.renderErrorMessage('amount'),
|
||||
!errors.amount && h('div.send-v2__amount-max', {
|
||||
!errors.amount && gasTotal && h('div.send-v2__amount-max', {
|
||||
onClick: (event) => {
|
||||
event.preventDefault()
|
||||
setMaxModeTo(true)
|
||||
@ -491,9 +493,12 @@ SendTransactionScreen.prototype.renderFooter = function () {
|
||||
goHome,
|
||||
clearSend,
|
||||
gasTotal,
|
||||
tokenBalance,
|
||||
selectedToken,
|
||||
errors: { amount: amountError, to: toError },
|
||||
} = this.props
|
||||
|
||||
const missingTokenBalance = selectedToken && !tokenBalance
|
||||
const noErrors = !amountError && toError === null
|
||||
|
||||
return h('div.page-container__footer', [
|
||||
@ -504,7 +509,7 @@ SendTransactionScreen.prototype.renderFooter = function () {
|
||||
},
|
||||
}, 'Cancel'),
|
||||
h('button.btn-clear.page-container__footer-button', {
|
||||
disabled: !noErrors || !gasTotal,
|
||||
disabled: !noErrors || !gasTotal || missingTokenBalance,
|
||||
onClick: event => this.onSubmit(event),
|
||||
}, 'Next'),
|
||||
])
|
||||
|
@ -71,7 +71,7 @@ UnlockScreen.prototype.render = function () {
|
||||
style: {
|
||||
margin: 10,
|
||||
},
|
||||
}, 'Unlock'),
|
||||
}, 'Log In'),
|
||||
]),
|
||||
|
||||
h('.flex-row.flex-center.flex-grow', [
|
||||
@ -104,7 +104,7 @@ UnlockScreen.prototype.render = function () {
|
||||
},
|
||||
}, 'Use classic interface'),
|
||||
]),
|
||||
|
||||
|
||||
])
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user