aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/config-manager.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib/config-manager.js')
-rw-r--r--app/scripts/lib/config-manager.js9
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
+}