Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #12181 from xiemaisi/fix-lgtm-alerts
Browse files Browse the repository at this point in the history
Fix issues found by lgtm
  • Loading branch information
bsclifton authored Feb 13, 2018
2 parents 084744e + 5aa804b commit cd99dc6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
12 changes: 5 additions & 7 deletions app/browser/api/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ const pageDataChanged = (state, viewData = {}, keepInfo = false) => {
}
}

if (!publisherKey || (publisherKey && ledgerUtil.blockedP(state, publisherKey))) {
if (!publisherKey || (ledgerUtil.blockedP(state, publisherKey))) {
publisherKey = null
}

Expand Down Expand Up @@ -1040,11 +1040,9 @@ const recoverKeys = (state, useRecoveryKeyFile, key) => {
return state
}

if (recoveryKeyFile) {
const result = loadKeysFromBackupFile(state, recoveryKeyFile)
recoveryKey = result.recoveryKey || ''
state = result.state
}
const result = loadKeysFromBackupFile(state, recoveryKeyFile)
recoveryKey = result.recoveryKey || ''
state = result.state
}

if (!recoveryKey) {
Expand Down Expand Up @@ -2399,7 +2397,7 @@ const transitionWalletToBat = () => {
}

// only attempt this transition if the wallet is v1
if (client && client.options && client.options.version !== 'v1') {
if (client.options && client.options.version !== 'v1') {
// older versions incorrectly marked this for transition
// this will clean them up (no more bouncy ball)
appActions.onBitcoinToBatTransitioned()
Expand Down
2 changes: 1 addition & 1 deletion app/common/commonMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ module.exports.submitFeedbackMenuItem = () => {
click: function (item, focusedWindow) {
ensureAtLeastOneWindow({
url: communityURL
}, true)
})
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/common/lib/ledgerExportUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ const getTransactionsByViewingIds = (transactions, viewingIds) => {
return transactions
}

if (viewingIds && typeof (viewingIds) === 'string') {
if (typeof (viewingIds) === 'string') {
viewingIds = [viewingIds]
}
if (viewingIds && !viewingIds.length) {
if (!viewingIds.length) {
viewingIds = null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class AddFundsWizardAddress extends React.Component {
data-l10n-args={JSON.stringify({
currencyName: this.currencyName,
currency: this.currency
} || {})}
})}
/>
<div className={css(styles.address__main)}>
<main className={css(styles.address__main__inputBox)}>
Expand All @@ -107,14 +107,14 @@ class AddFundsWizardAddress extends React.Component {
data-l10n-args={JSON.stringify({
currency: this.currency,
funds: this.props.minAmount
} || {})}
})}
className={css(
styles.address__main__text_small,
styles.address__main__inputBox__text
)}
/>
<p data-l10n-id={this.footerNote}
data-l10n-args={JSON.stringify({currency: this.currency} || {})}
data-l10n-args={JSON.stringify({currency: this.currency})}
className={css(
styles.address__main__text_small,
styles.address__main__inputBox__text
Expand Down
2 changes: 1 addition & 1 deletion js/lib/urlutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ const UrlUtil = {
}

const localFileOrigins = ['file:', 'blob:', 'data:', 'chrome-extension:', 'chrome:']
return origin && localFileOrigins.some((localFileOrigin) => origin.startsWith(localFileOrigin))
return localFileOrigins.some((localFileOrigin) => origin.startsWith(localFileOrigin))
},

getDisplayHost: (url) => {
Expand Down

0 comments on commit cd99dc6

Please sign in to comment.