Skip to content

Commit

Permalink
Merge branch 'develop' into gaba-addressbookcontroller
Browse files Browse the repository at this point in the history
  • Loading branch information
jennypollack committed Mar 12, 2019
2 parents 6a3694e + 59dbb9b commit a80093d
Show file tree
Hide file tree
Showing 107 changed files with 2,432 additions and 269 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Current Develop Branch

## 6.2.1 Wed Mar 06 2019

## 6.2.0 Tue Mar 05 2019
- [#6192](https://github.com/MetaMask/metamask-extension/pull/6192): Improves design and UX of onboarding flow
- [#6195](https://github.com/MetaMask/metamask-extension/pull/6195): Fixes gas estimation when sending to contracts
- [#6223](https://github.com/MetaMask/metamask-extension/pull/6223): Fixes display of notification windows when metamask is active in a tab
- [#6171](https://github.com/MetaMask/metamask-extension/pull/6171): Adds MetaMetrics usage analytics system

## 6.1.0 Tue Feb 19 2019

- [#6182](https://github.com/MetaMask/metamask-extension/pull/6182): Change "Token Address" to "Token Contract Address"
Expand Down
24 changes: 21 additions & 3 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,15 +470,21 @@
"message": "Tips on storing it safely"
},
"endOfFlowMessage3": {
"message": "Save a backup in multiple places"
"message": "Save a backup in multiple places."
},
"endOfFlowMessage4": {
"message": "Never tell anyone"
"message": "Never share the phrase with anyone."
},
"endOfFlowMessage5": {
"message": "If you need to back your seed phrase again, you can find it in Settings -> Security."
"message": "Be careful of phishing! MetaMask will never spontaneously ask for your seed phrase."
},
"endOfFlowMessage6": {
"message": "If you need to back your up seed phrase again, you can find it in Settings -> Security."
},
"endOfFlowMessage7": {
"message": "If you ever have questions or see something fishy, email [email protected]."
},
"endOfFlowMessage8": {
"message": "MetaMask cannot recover your seedphrase. Learn more."
},
"ensNameNotFound": {
Expand Down Expand Up @@ -689,6 +695,9 @@
"importWallet": {
"message": "Import Wallet"
},
"importYourExisting": {
"message": "Import your existing wallet using a 12 word seed phrase"
},
"imported": {
"message": "Imported",
"description": "status showing that an account has been fully loaded into the keyring"
Expand Down Expand Up @@ -1000,6 +1009,12 @@
"originalTotal": {
"message": "Original Total"
},
"participateInMetaMetrics": {
"message": "Participate in MetaMetrics"
},
"participateInMetaMetricsDescription": {
"message": "Participate in MetaMetrics to help us make MetaMask better"
},
"password": {
"message": "Password"
},
Expand Down Expand Up @@ -1435,6 +1450,9 @@
"testFaucet": {
"message": "Test Faucet"
},
"thisWillCreate": {
"message": "This will create a new wallet and seed phrase"
},
"tips": {
"message": "Tips"
},
Expand Down
36 changes: 18 additions & 18 deletions app/_locales/es/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@
"message": "Restaurar desde semilla"
},
"restoreVault": {
"message": "Restaurar Bóveda"
"message": "Restaurar bóveda"
},
"retryWithMoreGas": {
"message": "Vuelva a intentar con un precio de gas más alto aquí"
Expand Down Expand Up @@ -1168,10 +1168,10 @@
"message": "Nuevo URL de RPC"
},
"showAdvancedOptions": {
"message": "Mostrar Opciones Avanzadas"
"message": "Mostrar opciones avanzadas"
},
"hideAdvancedOptions": {
"message": "Ocultar Opciones Avanzadas"
"message": "Ocultar opciones avanzadas"
},
"optionalChainId": {
"message": "ChainID (opcional)"
Expand All @@ -1183,13 +1183,13 @@
"message": "Apodo (opcional)"
},
"newTotal": {
"message": "Nuevo Total"
"message": "Nuevo total"
},
"newTransactionFee": {
"message": "Nueva Comisión por Transacción"
"message": "Nueva Comisión por transacción"
},
"noConversionRateAvailable": {
"message": "No Hay Tasa de Conversión"
"message": "No hay tasa de conversión"
},
"notFound": {
"message": "No se encontró"
Expand Down Expand Up @@ -1238,7 +1238,7 @@
"message": "Prev"
},
"primaryCurrencySetting": {
"message": "Moneda Principal"
"message": "Moneda principal"
},
"primaryCurrencySettingDescription": {
"message": "Seleccionar nativa para prioritizar el que se muestren los valores en la moneda nativa de la cadena (p.ej. ETH). Seleccionar Fíat para prioritzar el que se muestren los valores en la moneda fíat seleccionada."
Expand All @@ -1247,10 +1247,10 @@
"message": "Cola"
},
"rejectAll": {
"message": "Rechazar a Todos"
"message": "Rechazar todas"
},
"rejectTxsN": {
"message": "Rechazar a transacciones de $1"
"message": "Rechazar transacciones de $1"
},
"rejectTxsDescription": {
"message": "Está al punto de rechazar transacciones de $1 en lote."
Expand All @@ -1271,7 +1271,7 @@
"message": "Restaurar"
},
"revealSeedWordsTitle": {
"message": "Frase Semilla"
"message": "Frase semilla"
},
"revealSeedWordsDescription": {
"message": "Si en algún momento cambias de navegador o de ordenador, necesitarás esta frase semilla para acceder a tus cuentas. Guárdatela en un lugar seguro y secreto."
Expand All @@ -1298,7 +1298,7 @@
"message": "Lento"
},
"slower": {
"message": "Más Lento"
"message": "Más lento"
},
"saveAsCsvFile": {
"message": "Guardar como archivo CSV"
Expand All @@ -1316,10 +1316,10 @@
"message": "Seg"
},
"selectLocale": {
"message": "Seleccionar Local"
"message": "Seleccionar local"
},
"sendAmount": {
"message": "Mandar Cantidad"
"message": "Mandar cantidad"
},
"sentEther": {
"message": "se mandó ether"
Expand Down Expand Up @@ -1361,7 +1361,7 @@
"message": "Petición de Firma"
},
"somethingWentWrong": {
"message": "¡Ups! Algo se estropeó."
"message": "¡Ups! Algo funcionó mal."
},
"speedUp": {
"message": "Agilizar"
Expand All @@ -1382,13 +1382,13 @@
"message": "Cambiar de Red"
},
"step1HardwareWallet": {
"message": "1. Conectar Monedero Físico."
"message": "1. Conectar monedero físico."
},
"step1HardwareWalletMsg": {
"message": "Conéctate el monedero físico directamente al ordenador."
},
"step2HardwareWallet": {
"message": "2. Seleccionar una Cuenta"
"message": "2. Seleccionar una cuenta"
},
"step2HardwareWalletMsg": {
"message": "Seleccione la cuenta que quieres ver. Sólo se puede eligir una a la vez."
Expand Down Expand Up @@ -1454,10 +1454,10 @@
"message": "Traspasar"
},
"transferFrom": {
"message": "Traspasar De"
"message": "Traspasar de"
},
"trezorHardwareWallet": {
"message": "Monedero Físico TREZOR"
"message": "Monedero físico TREZOR"
},
"tryAgain": {
"message": "Vuelve a intentar"
Expand Down
8 changes: 8 additions & 0 deletions app/images/metrics-chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appName__",
"version": "6.1.0",
"version": "6.2.1",
"manifest_version": 2,
"author": "https://metamask.io",
"description": "__MSG_appDescription__",
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ function setupController (initState, initLangCode) {
function triggerUi () {
extension.tabs.query({ active: true }, tabs => {
const currentlyActiveMetamaskTab = Boolean(tabs.find(tab => openMetamaskTabsIDs[tab.id]))
if ((!popupIsOpen || !notificationIsOpen) && !currentlyActiveMetamaskTab) {
if (!popupIsOpen && !currentlyActiveMetamaskTab && !notificationIsOpen) {
notificationManager.showPopup()
notificationIsOpen = true
}
Expand Down
44 changes: 43 additions & 1 deletion app/scripts/controllers/preferences.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const ObservableStore = require('obs-store')
const normalizeAddress = require('eth-sig-util').normalize
const { isValidAddress } = require('ethereumjs-util')
const { isValidAddress, sha3, bufferToHex } = require('ethereumjs-util')
const extend = require('xtend')


Expand Down Expand Up @@ -42,6 +42,8 @@ class PreferencesController {
// perform sensitive operations.
featureFlags: {},
knownMethodData: {},
participateInMetaMetrics: null,
firstTimeFlowType: null,
currentLocale: opts.initLangCode,
identities: {},
lostIdentities: {},
Expand All @@ -52,6 +54,8 @@ class PreferencesController {
},
completedOnboarding: false,
completedUiMigration: true,
metaMetricsId: null,
metaMetricsSendCount: 0,
}, opts.initState)

this.diagnostics = opts.diagnostics
Expand Down Expand Up @@ -92,6 +96,44 @@ class PreferencesController {
this.store.updateState({ useBlockie: val })
}

/**
* Setter for the `participateInMetaMetrics` property
*
* @param {boolean} bool Whether or not the user wants to participate in MetaMetrics
* @returns {string|null} the string of the new metametrics id, or null if not set
*
*/
setParticipateInMetaMetrics (bool) {
this.store.updateState({ participateInMetaMetrics: bool })
let metaMetricsId = null
if (bool && !this.store.getState().metaMetricsId) {
metaMetricsId = bufferToHex(sha3(String(Date.now()) + String(Math.round(Math.random() * Number.MAX_SAFE_INTEGER))))
this.store.updateState({ metaMetricsId })
} else if (bool === false) {
this.store.updateState({ metaMetricsId })
}
return metaMetricsId
}

setMetaMetricsSendCount (val) {
this.store.updateState({ metaMetricsSendCount: val })
}

getMetaMetricsSendCount () {
return this.store.getState().metaMetricsSendCount
}

/**
* Setter for the `firstTimeFlowType` property
*
* @param {String} type Indicates the type of first time flow - create or import - the user wishes to follow
*
*/
setFirstTimeFlowType (type) {
this.store.updateState({ firstTimeFlowType: type })
}


getSuggestedTokens () {
return this.store.getState().suggestedTokens
}
Expand Down
41 changes: 41 additions & 0 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ module.exports = class MetamaskController extends EventEmitter {
getState: (cb) => cb(null, this.getState()),
setCurrentCurrency: this.setCurrentCurrency.bind(this),
setUseBlockie: this.setUseBlockie.bind(this),
setParticipateInMetaMetrics: this.setParticipateInMetaMetrics.bind(this),
setMetaMetricsSendCount: this.setMetaMetricsSendCount.bind(this),
setFirstTimeFlowType: this.setFirstTimeFlowType.bind(this),
setCurrentLocale: this.setCurrentLocale.bind(this),
markAccountsFound: this.markAccountsFound.bind(this),
markPasswordForgotten: this.markPasswordForgotten.bind(this),
Expand Down Expand Up @@ -1619,6 +1622,44 @@ module.exports = class MetamaskController extends EventEmitter {
}
}

/**
* Sets whether or not the user will have usage data tracked with MetaMetrics
* @param {boolean} bool - True for users that wish to opt-in, false for users that wish to remain out.
* @param {Function} cb - A callback function called when complete.
*/
setParticipateInMetaMetrics (bool, cb) {
try {
const metaMetricsId = this.preferencesController.setParticipateInMetaMetrics(bool)
cb(null, metaMetricsId)
} catch (err) {
cb(err)
}
}

setMetaMetricsSendCount (val, cb) {
try {
this.preferencesController.setMetaMetricsSendCount(val)
cb(null)
} catch (err) {
cb(err)
}
}

/**
* Sets the type of first time flow the user wishes to follow: create or import
* @param {String} type - Indicates the type of first time flow the user wishes to follow
* @param {Function} cb - A callback function called when complete.
*/
setFirstTimeFlowType (type, cb) {
try {
this.preferencesController.setFirstTimeFlowType(type)
cb(null)
} catch (err) {
cb(err)
}
}


/**
* A method for setting a user's current locale, affecting the language rendered.
* @param {string} key - Locale identifier.
Expand Down
Loading

0 comments on commit a80093d

Please sign in to comment.