1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Lint fixes.

This commit is contained in:
Dan 2018-03-19 16:53:06 -02:30
parent 4d1793b0ec
commit 2ddc2cc1fb
16 changed files with 19 additions and 11 deletions

View File

@ -9,7 +9,6 @@ const ExtensionPlatform = require('./platforms/extension')
const NotificationManager = require('./lib/notification-manager') const NotificationManager = require('./lib/notification-manager')
const notificationManager = new NotificationManager() const notificationManager = new NotificationManager()
const setupRaven = require('./lib/setupRaven') const setupRaven = require('./lib/setupRaven')
const { fetchLocale } = require('../../ui/i18n-helper.js')
start().catch(log.error) start().catch(log.error)

View File

@ -2,6 +2,7 @@ const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../../metamask-connect') const connect = require('../../metamask-connect')
const t = require('../../../i18n-helper').getMessage
import Select from 'react-select' import Select from 'react-select'
// Subviews // Subviews

View File

@ -113,6 +113,7 @@ JsonImportSubview.propTypes = {
goHome: PropTypes.func, goHome: PropTypes.func,
displayWarning: PropTypes.func, displayWarning: PropTypes.func,
importNewJsonAccount: PropTypes.func, importNewJsonAccount: PropTypes.func,
localeMessages: PropTypes.object,
} }
const mapStateToProps = state => { const mapStateToProps = state => {

View File

@ -62,6 +62,7 @@ NewAccountCreateForm.propTypes = {
createAccount: PropTypes.func, createAccount: PropTypes.func,
goHome: PropTypes.func, goHome: PropTypes.func,
numberOfExistingAccounts: PropTypes.number, numberOfExistingAccounts: PropTypes.number,
localeMessages: PropTypes.object,
} }
const mapStateToProps = state => { const mapStateToProps = state => {

View File

@ -1802,7 +1802,6 @@ function updateCurrentLocale (key) {
return (dispatch) => { return (dispatch) => {
dispatch(actions.showLoadingIndication()) dispatch(actions.showLoadingIndication())
log.debug(`background.updateCurrentLocale`) log.debug(`background.updateCurrentLocale`)
console.log(`fetchLocale`, fetchLocale);
fetchLocale(key) fetchLocale(key)
.then((localeMessages) => { .then((localeMessages) => {
background.setCurrentLocale(key, (err) => { background.setCurrentLocale(key, (err) => {

View File

@ -9,6 +9,7 @@ const DropdownMenuItem = require('./dropdown').DropdownMenuItem
const Identicon = require('./identicon') const Identicon = require('./identicon')
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
const copyToClipboard = require('copy-to-clipboard') const copyToClipboard = require('copy-to-clipboard')
const t = require('../../i18n-helper').getMessage
class AccountDropdowns extends Component { class AccountDropdowns extends Component {
constructor (props) { constructor (props) {
@ -300,6 +301,7 @@ AccountDropdowns.propTypes = {
style: PropTypes.object, style: PropTypes.object,
enableAccountOptions: PropTypes.bool, enableAccountOptions: PropTypes.bool,
enableAccountsSelector: PropTypes.bool, enableAccountsSelector: PropTypes.bool,
localeMessages: PropTypes.object,
} }
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {

View File

@ -426,6 +426,7 @@ AccountDropdowns.propTypes = {
enableAccountsSelector: PropTypes.bool, enableAccountsSelector: PropTypes.bool,
enableAccountOption: PropTypes.bool, enableAccountOption: PropTypes.bool,
enableAccountOptions: PropTypes.bool, enableAccountOptions: PropTypes.bool,
localeMessages: PropTypes.object,
} }
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {

View File

@ -70,6 +70,7 @@ NewAccountModal.propTypes = {
showImportPage: PropTypes.func, showImportPage: PropTypes.func,
createAccount: PropTypes.func, createAccount: PropTypes.func,
numberOfExistingAccounts: PropTypes.number, numberOfExistingAccounts: PropTypes.number,
localeMessages: PropTypes.object,
} }
const mapStateToProps = state => { const mapStateToProps = state => {

View File

@ -63,6 +63,7 @@ NotificationModal.propTypes = {
showCancelButton: PropTypes.bool, showCancelButton: PropTypes.bool,
showConfirmButton: PropTypes.bool, showConfirmButton: PropTypes.bool,
onConfirm: PropTypes.func, onConfirm: PropTypes.func,
localeMessages: PropTypes.object,
} }
const mapDispatchToProps = dispatch => { const mapDispatchToProps = dispatch => {

View File

@ -79,8 +79,6 @@ Network.prototype.render = function () {
}, },
}, [ }, [
(function () { (function () {
console.log(`12312312312312312 props.localeMessages`, props.localeMessages);
console.log(`12312312312312312 t(props.localeMessages, 'mainnet')`, t(props.localeMessages, 'mainnet'));
switch (iconName) { switch (iconName) {
case 'ethereum-network': case 'ethereum-network':
return h('.network-indicator', [ return h('.network-indicator', [

View File

@ -321,6 +321,7 @@ ConfirmDeployContract.propTypes = {
conversionRate: PropTypes.number, conversionRate: PropTypes.number,
currentCurrency: PropTypes.string, currentCurrency: PropTypes.string,
selectedAddress: PropTypes.string, selectedAddress: PropTypes.string,
localeMessages: PropTypes.object,
} }
const mapStateToProps = state => { const mapStateToProps = state => {
@ -347,4 +348,4 @@ const mapDispatchToProps = dispatch => {
} }
} }
module.exports = connect(mapStateToProps, mapDispatchToProps)(ConfirmDeployContract) module.exports = connect(mapStateToProps, mapDispatchToProps)(ConfirmDeployContract)

View File

@ -378,7 +378,8 @@ ConfirmSendToken.prototype.render = function () {
this.renderTotalPlusGas(), this.renderTotalPlusGas(),
]) ]),
]), ]),
h('form#pending-tx-form', { h('form#pending-tx-form', {

View File

@ -1,5 +1,6 @@
const { Component } = require('react') const { Component } = require('react')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../metamask-connect')
const PropTypes = require('prop-types') const PropTypes = require('prop-types')
const t = require('../../i18n-helper').getMessage const t = require('../../i18n-helper').getMessage
const Identicon = require('./identicon') const Identicon = require('./identicon')
@ -40,6 +41,9 @@ class SenderToRecipient extends Component {
SenderToRecipient.propTypes = { SenderToRecipient.propTypes = {
senderName: PropTypes.string, senderName: PropTypes.string,
senderAddress: PropTypes.string, senderAddress: PropTypes.string,
localeMessages: PropTypes.object,
} }
module.exports = SenderToRecipient module.exports = {
AccountDropdowns: connect()(SenderToRecipient),
}

View File

@ -1,8 +1,5 @@
const extend = require('xtend') const extend = require('xtend')
const actions = require('../actions') const actions = require('../actions')
const MetamascaraPlatform = require('../../../app/scripts/platforms/window')
const environmentType = require('../../../app/scripts/lib/environment-type')
const { OLD_UI_NETWORK_TYPE } = require('../../../app/scripts/config').enums
module.exports = reduceMetamask module.exports = reduceMetamask

View File

@ -457,6 +457,8 @@ Settings.propTypes = {
warning: PropTypes.string, warning: PropTypes.string,
goHome: PropTypes.func, goHome: PropTypes.func,
isMascara: PropTypes.bool, isMascara: PropTypes.bool,
updateCurrentLocale: PropTypes.func,
currentLocale: PropTypes.object,
} }
const mapStateToProps = state => { const mapStateToProps = state => {

View File

@ -1,5 +1,4 @@
// cross-browser connection to extension i18n API // cross-browser connection to extension i18n API
const extension = require('extensionizer')
const log = require('loglevel') const log = require('loglevel')
const getMessage = (locale, key, substitutions) => { const getMessage = (locale, key, substitutions) => {