Merge remote-tracking branch 'origin/develop' into poa-autodetect-tokens

This commit is contained in:
Victor Baranov 2018-10-31 19:20:48 +03:00
commit 5d9f600239
4 changed files with 31 additions and 18 deletions

View File

@ -96,7 +96,9 @@ class BlacklistController {
*
*/
scheduleUpdates () {
if (this._phishingUpdateIntervalRef) return
if (this._phishingUpdateIntervalRef) {
clearInterval(this._phishingUpdateIntervalRef)
}
this.updatePhishingList().catch(log.warn)
this._phishingUpdateIntervalRef = setInterval(() => {
this.updatePhishingList().catch(log.warn)

View File

@ -109,22 +109,23 @@ class ExtensionPlatform {
})
}
_subscribeToNotificationClicked () {
if (!extension.notifications.onClicked.hasListener(this._viewOnEtherScan)) {
extension.notifications.onClicked.addListener(this._viewOnEtherScan)
_subscribeToNotificationClicked = () => {
if (!extension.notifications.onClicked.hasListener(this._viewOnExplorer)) {
extension.notifications.onClicked.addListener((url) => this._viewOnExplorer(url))
}
}
_viewOnEtherScan (txId) {
if (txId.startsWith('http://') || txId.startsWith('https://')) {
global.metamaskController.platform.openWindow({ url: txId })
_viewOnExplorer (url) {
if (url.startsWith('http://') || url.startsWith('https://')) {
extension.notifications.onClicked.removeListener(this._viewOnExplorer)
global.metamaskController.platform.openWindow({ url })
}
}
_getExplorer (hash, networkId) {
let explorerName
if (networkId === 99 || networkId === 77) {
explorerName = 'POA explorer'
if (networkId === 99 || networkId === 100 || networkId === 77) {
explorerName = 'BlockScout'
} else {
explorerName = 'Etherscan'
}

View File

@ -80,24 +80,24 @@ MenuDroppoComponent.prototype.componentDidMount = function () {
this.container = container
}
this.transitionStarted = this.transitionstartOccured.bind(this)
/*
* transitionstart event is not supported in Chrome yet. But it works for Firefox 53+.
* We need to handle this event only for FF because for Chrome we've hidden scrolls.
*/
this.refs.menuDroppoContainer.addEventListener('transitionstart', () => {
this.refs.menuDroppoContainer.style.overflow = 'hidden'
})
this.refs.menuDroppoContainer.addEventListener('transitionstart', this.transitionStarted)
this.refs.menuDroppoContainer.addEventListener('transitionend', () => {
if (!this.props.constOverflow) {
this.refs.menuDroppoContainer.style.overflow = 'auto'
}
})
this.transitionEnded = this.transitionendOccured.bind(this)
this.refs.menuDroppoContainer.addEventListener('transitionend', this.transitionEnded)
}
MenuDroppoComponent.prototype.componentWillUnmount = function () {
if (this && document.body) {
document.body.removeEventListener('click', this.globalClickHandler)
document.body.removeEventListener('transitionstart', this.transitionStarted)
document.body.removeEventListener('transitionend', this.transitionEnded)
}
}
@ -113,6 +113,16 @@ MenuDroppoComponent.prototype.globalClickOccurred = function (event) {
}
}
MenuDroppoComponent.prototype.transitionstartOccured = function (event) {
this.refs.menuDroppoContainer.style.overflow = 'hidden'
}
MenuDroppoComponent.prototype.transitionendOccured = function (event) {
if (!this.props.constOverflow) {
this.refs.menuDroppoContainer.style.overflow = 'auto'
}
}
function isDescendant (parent, child) {
var node = child.parentNode
while (node !== null) {

View File

@ -65,7 +65,7 @@ TransactionListItem.prototype.render = function () {
let isLinkable = false
const numericNet = parseInt(network)
isLinkable = numericNet === 1 || numericNet === 3 || numericNet === 4 || numericNet === 42 || numericNet === 77 || numericNet === 99
isLinkable = numericNet === 1 || numericNet === 3 || numericNet === 4 || numericNet === 42 || numericNet === 77 || numericNet === 99 || numericNet === 100
var isMsg = ('msgParams' in transaction)
var isTx = ('txParams' in transaction)