mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-19 05:45:15 +01:00
REF: widgets lastUpdated fix
This commit is contained in:
parent
abc988f97e
commit
4f18821f9b
@ -55,12 +55,13 @@ class WidgetAPI {
|
|||||||
let rateDouble = rateDict["price"] as? Double,
|
let rateDouble = rateDict["price"] as? Double,
|
||||||
let lastUpdated = json["timestamp"] as? Int
|
let lastUpdated = json["timestamp"] as? Int
|
||||||
else { break }
|
else { break }
|
||||||
latestRateDataStore = WidgetDataStore(rate: String(rateDouble), lastUpdate: String(lastUpdated), rateDouble: rateDouble)
|
let unix = Double(lastUpdated / 1_000)
|
||||||
|
let lastUpdatedString = ISO8601DateFormatter().string(from: Date(timeIntervalSince1970: unix))
|
||||||
|
latestRateDataStore = WidgetDataStore(rate: String(rateDouble), lastUpdate: lastUpdatedString, rateDouble: rateDouble)
|
||||||
case "BitcoinduLiban":
|
case "BitcoinduLiban":
|
||||||
guard let rateString = json["BTC/LBP"] as? String,
|
guard let rateString = json["BTC/LBP"] as? String else { break }
|
||||||
let lastUpdatedString = json["date/time"] as? String
|
|
||||||
else { break }
|
|
||||||
guard let rateDouble = Double(rateString) else {return}
|
guard let rateDouble = Double(rateString) else {return}
|
||||||
|
let lastUpdatedString = ISO8601DateFormatter().string(from: Date())
|
||||||
latestRateDataStore = WidgetDataStore(rate: rateString, lastUpdate: lastUpdatedString, rateDouble: rateDouble)
|
latestRateDataStore = WidgetDataStore(rate: rateString, lastUpdate: lastUpdatedString, rateDouble: rateDouble)
|
||||||
default:
|
default:
|
||||||
guard let bpi = json["bpi"] as? Dictionary<String, Any>,
|
guard let bpi = json["bpi"] as? Dictionary<String, Any>,
|
||||||
|
Loading…
Reference in New Issue
Block a user