diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-07-22 05:08:26 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-07-22 05:08:26 +0800 |
commit | 716e65424d2ba490a384bfc1f0591685eb2867fa (patch) | |
tree | 1114035df2478f4d3b5f76984f3230acf81ae200 /app/scripts | |
parent | 66941f0808cd8052bd5a90b10900e49e071ba727 (diff) | |
download | tangerine-wallet-browser-716e65424d2ba490a384bfc1f0591685eb2867fa.tar tangerine-wallet-browser-716e65424d2ba490a384bfc1f0591685eb2867fa.tar.gz tangerine-wallet-browser-716e65424d2ba490a384bfc1f0591685eb2867fa.tar.bz2 tangerine-wallet-browser-716e65424d2ba490a384bfc1f0591685eb2867fa.tar.lz tangerine-wallet-browser-716e65424d2ba490a384bfc1f0591685eb2867fa.tar.xz tangerine-wallet-browser-716e65424d2ba490a384bfc1f0591685eb2867fa.tar.zst tangerine-wallet-browser-716e65424d2ba490a384bfc1f0591685eb2867fa.zip |
Add date access throughout the data flow.
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/lib/config-manager.js | 6 | ||||
-rw-r--r-- | app/scripts/lib/idStore.js | 3 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 1 |
3 files changed, 6 insertions, 4 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index cd0d37e98..03f8c054d 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -288,7 +288,7 @@ ConfigManager.prototype.setConversionRate = function () { .then(function (response) { const parsedResponse = JSON.parse(response) data.conversionRate = Number(parsedResponse.ticker.price) - data.conversionLastUpdated = new Date(parsedResponse.timestamp).toString() + data.conversionDate = new Date(parsedResponse.timestamp).toString() this.setData(data) }.bind(this)).catch(function (err) { console.log('Error in conversion.', err) @@ -300,7 +300,7 @@ ConfigManager.prototype.getConversionRate = function () { return ('conversionRate' in data) && data.conversionRate } -ConfigManager.prototype.getConversionLastUpdated = function () { +ConfigManager.prototype.getConversionDate = function () { var data = this.getData() - return ('conversionLastUpdated' in data) && data.conversionLastUpdated + return ('conversionDate' in data) && data.conversionDate } diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 94aaad1d1..b6c136b8f 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -100,7 +100,8 @@ IdentityStore.prototype.getState = function () { messages: messageManager.getMsgList(), selectedAddress: configManager.getSelectedAccount(), currentFiat: configManager.getCurrentFiat(), - currentConversion: configManager.getConversionRate(), + conversionRate: configManager.getConversionRate(), + conversionDate: configManager.getConversionDate(), })) } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 7bf8fd5ea..99769fa3c 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -245,6 +245,7 @@ module.exports = class MetamaskController { const data = { conversionRate: this.configManager.getConversionRate, currentFiat: this.configManager.getCurrentFiat, + conversionDate: this.configManager.getConversionDate, } cb(data) } catch (e) { |