diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-07-22 04:33:22 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-07-22 04:33:22 +0800 |
commit | 66941f0808cd8052bd5a90b10900e49e071ba727 (patch) | |
tree | 69c7aaa580c90e0978ea3cac2a8bbddab20d325a /app/scripts/lib/config-manager.js | |
parent | 7b85802a0fede74217dd702ddda9bea1154517eb (diff) | |
download | tangerine-wallet-browser-66941f0808cd8052bd5a90b10900e49e071ba727.tar tangerine-wallet-browser-66941f0808cd8052bd5a90b10900e49e071ba727.tar.gz tangerine-wallet-browser-66941f0808cd8052bd5a90b10900e49e071ba727.tar.bz2 tangerine-wallet-browser-66941f0808cd8052bd5a90b10900e49e071ba727.tar.lz tangerine-wallet-browser-66941f0808cd8052bd5a90b10900e49e071ba727.tar.xz tangerine-wallet-browser-66941f0808cd8052bd5a90b10900e49e071ba727.tar.zst tangerine-wallet-browser-66941f0808cd8052bd5a90b10900e49e071ba727.zip |
Provide date access.
Diffstat (limited to 'app/scripts/lib/config-manager.js')
-rw-r--r-- | app/scripts/lib/config-manager.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index a5b319325..cd0d37e98 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -286,7 +286,9 @@ ConfigManager.prototype.setConversionRate = function () { var data = this.getData() return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) .then(function (response) { - data.conversionRate = Number(JSON.parse(response).ticker.price) + const parsedResponse = JSON.parse(response) + data.conversionRate = Number(parsedResponse.ticker.price) + data.conversionLastUpdated = new Date(parsedResponse.timestamp).toString() this.setData(data) }.bind(this)).catch(function (err) { console.log('Error in conversion.', err) @@ -297,3 +299,8 @@ ConfigManager.prototype.getConversionRate = function () { var data = this.getData() return ('conversionRate' in data) && data.conversionRate } + +ConfigManager.prototype.getConversionLastUpdated = function () { + var data = this.getData() + return ('conversionLastUpdated' in data) && data.conversionLastUpdated +} |