mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
Merge pull request #5315 from BlueWallet/apifix
FIX: Type casting in Widget parse
This commit is contained in:
commit
52c1a78c13
@ -71,11 +71,15 @@ class WidgetAPI {
|
||||
let unix = Double(lastUpdated / 1_000)
|
||||
let lastUpdatedString = ISO8601DateFormatter().string(from: Date(timeIntervalSince1970: unix))
|
||||
latestRateDataStore = WidgetDataStore(rate: String(rateDouble), lastUpdate: lastUpdatedString, rateDouble: rateDouble)
|
||||
case "Exir", "Bitstamp":
|
||||
case "Exir":
|
||||
guard let rateDouble = json["last"] as? Double else { break }
|
||||
let rateString = String(rateDouble)
|
||||
let lastUpdatedString = ISO8601DateFormatter().string(from: Date())
|
||||
latestRateDataStore = WidgetDataStore(rate: rateString, lastUpdate: lastUpdatedString, rateDouble: rateDouble)
|
||||
case "Bitstamp":
|
||||
guard let rateString = json["last"] as? String, let rateDouble = Double(rateString) else { break }
|
||||
let lastUpdatedString = ISO8601DateFormatter().string(from: Date())
|
||||
latestRateDataStore = WidgetDataStore(rate: rateString, lastUpdate: lastUpdatedString, rateDouble: rateDouble)
|
||||
case "wazirx":
|
||||
guard let tickerDict = json["ticker"] as? [String: Any],
|
||||
let rateString = tickerDict["buy"] as? String,
|
||||
|
Loading…
Reference in New Issue
Block a user