From 9328e96d8084b8bd6bc8e6486809da94883754a5 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 23 Aug 2016 16:53:05 -0700 Subject: Add shortcut for opening MetaMask. --- app/manifest.json | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index 09bc9eb37..99879eed3 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -4,6 +4,16 @@ "version": "2.9.0", "manifest_version": 2, "description": "Ethereum Browser Extension", + "commands": { + "_execute_browser_action": { + "suggested_key": { + "windows": "Ctrl+M", + "mac": "Command+M", + "chromeos": "Ctrl+M", + "linux": "Ctrl+M" + } + } + }, "icons": { "16": "images/icon-16.png", "128": "images/icon-128.png" -- cgit v1.2.3 From 1444f5451fc78b3cb74a6f54ed18ccec129f0988 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 24 Aug 2016 10:25:59 -0700 Subject: Change shortcut to Alt+M --- app/manifest.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index 99879eed3..cd471728b 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -7,10 +7,10 @@ "commands": { "_execute_browser_action": { "suggested_key": { - "windows": "Ctrl+M", - "mac": "Command+M", - "chromeos": "Ctrl+M", - "linux": "Ctrl+M" + "windows": "Alt+M", + "mac": "Alt+M", + "chromeos": "Alt+M", + "linux": "Alt+M" } } }, -- cgit v1.2.3 From cf5b8ba3882cbe7537eddc4ea3ad6495cec1ad75 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 24 Aug 2016 11:15:03 -0700 Subject: Change shortcut again to Ctrl+Alt+M --- app/manifest.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index cd471728b..c1b9ee817 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -7,10 +7,10 @@ "commands": { "_execute_browser_action": { "suggested_key": { - "windows": "Alt+M", - "mac": "Alt+M", - "chromeos": "Alt+M", - "linux": "Alt+M" + "windows": "Ctrl+Alt+M", + "mac": "Command+Alt+M", + "chromeos": "Ctrl+Alt+M", + "linux": "Ctrl+Alt+M" } } }, -- cgit v1.2.3 From d3d634d09c0c51ade2d750ee2d7f036f797757b0 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 24 Aug 2016 13:28:06 -0700 Subject: Added mock option to function. --- app/scripts/lib/config-manager.js | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 4d270bcdb..a37447fa2 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -288,21 +288,32 @@ ConfigManager.prototype.getCurrentFiat = function () { return ('fiatCurrency' in data) && data.fiatCurrency } -ConfigManager.prototype.updateConversionRate = function () { +ConfigManager.prototype.updateConversionRate = function (mock = false, mockCurrency = 'USD') { var data = this.getData() - return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) - .then((response) => { - const parsedResponse = JSON.parse(response) - this.setConversionPrice(parsedResponse.ticker.price) - this.setConversionDate(parsedResponse.timestamp) - }).catch((err) => { - console.error('Error in conversion.', err) - this.setConversionPrice(0) - this.setConversionDate('N/A') - }) + if (!mock) { + return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) + .then((response) => { + const parsedResponse = JSON.parse(response) + this.setConversionPrice(parsedResponse.ticker.price) + this.setConversionDate(parsedResponse.timestamp) + }).catch((err) => { + console.error('Error in conversion.', err) + this.setConversionPrice(0) + this.setConversionDate('N/A') + }) + } else { + return new Promise(function(resolve, reject) { resolve() }).then((response) => { + this.setConversionPrice('11.01') + this.setConversionDate(1472065924) + }).catch((err) => { + console.error('Error in conversion.', err) + this.setConversionPrice('11.01') + this.setConversionDate(1472065924) + }) + } } -ConfigManager.prototype.setConversionPrice = function(price) { +ConfigManager.prototype.setConversionPrice = function (price) { var data = this.getData() data.conversionRate = Number(price) this.setData(data) @@ -372,4 +383,3 @@ ConfigManager.prototype.createShapeShiftTx = function (depositAddress, depositTy } this.setData(data) } - -- cgit v1.2.3 From c82a494b4bc3bd12da52356119698cc380128669 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 24 Aug 2016 13:58:50 -0700 Subject: Implement usage of nock. --- app/scripts/lib/config-manager.js | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index a37447fa2..715efb42e 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -288,29 +288,19 @@ ConfigManager.prototype.getCurrentFiat = function () { return ('fiatCurrency' in data) && data.fiatCurrency } -ConfigManager.prototype.updateConversionRate = function (mock = false, mockCurrency = 'USD') { +ConfigManager.prototype.updateConversionRate = function () { var data = this.getData() - if (!mock) { - return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) - .then((response) => { - const parsedResponse = JSON.parse(response) - this.setConversionPrice(parsedResponse.ticker.price) - this.setConversionDate(parsedResponse.timestamp) - }).catch((err) => { - console.error('Error in conversion.', err) - this.setConversionPrice(0) - this.setConversionDate('N/A') - }) - } else { - return new Promise(function(resolve, reject) { resolve() }).then((response) => { - this.setConversionPrice('11.01') - this.setConversionDate(1472065924) - }).catch((err) => { - console.error('Error in conversion.', err) - this.setConversionPrice('11.01') - this.setConversionDate(1472065924) - }) - } + return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) + .then((response) => { + const parsedResponse = JSON.parse(response) + this.setConversionPrice(parsedResponse.ticker.price) + this.setConversionDate(parsedResponse.timestamp) + }).catch((err) => { + console.error('Error in conversion.', err) + this.setConversionPrice(0) + this.setConversionDate('N/A') + }) + } ConfigManager.prototype.setConversionPrice = function (price) { -- cgit v1.2.3