From f673c2a8a4d6aac1d22813c3e076fe91f08823f2 Mon Sep 17 00:00:00 2001 From: Nick Doiron Date: Sun, 28 Jan 2018 00:20:56 -0500 Subject: [PATCH] pass linter, update ui test --- test/integration/lib/first-time.js | 2 +- ui/i18n.js | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/test/integration/lib/first-time.js b/test/integration/lib/first-time.js index e59897713..318119902 100644 --- a/test/integration/lib/first-time.js +++ b/test/integration/lib/first-time.js @@ -41,7 +41,7 @@ async function runFirstTimeUsageTest(assert, done) { // Scroll through terms const title = app.find('h1').text() // TODO Find where Metamask is getting added twice in the title - assert.equal(title, 'MetaMaskMetaMask', 'title screen') + assert.equal(title, 'MetaMask', 'title screen') // enter password const pwBox = app.find('#password-box')[0] diff --git a/ui/i18n.js b/ui/i18n.js index c2cf9b449..0f4e9fce4 100644 --- a/ui/i18n.js +++ b/ui/i18n.js @@ -1,18 +1,20 @@ // cross-browser connection to extension i18n API -var getMessage; +const chrome = chrome || null +const browser = browser || null +let getMessage = null if ((chrome && chrome.i18n && chrome.i18n.getMessage) || (browser && browser.i18n && browser.i18n.getMessage)) { - getMessage = (chrome || browser).i18n.getMessage; + getMessage = (chrome || browser).i18n.getMessage } else { // fallback function - console.warn('browser.i18n API not available?'); - let msg = require('../app/_locales/en/messages.json'); - getMessage = function(key) { - return msg[key].message; - }; + console.warn('browser.i18n API not available?') + let msg = require('../app/_locales/en/messages.json') + getMessage = function (key) { + return msg[key].message + } } -module.exports = getMessage; +module.exports = getMessage