diff --git a/Cartfile b/Cartfile
index e745f5a87b..e2582e51dd 100644
--- a/Cartfile
+++ b/Cartfile
@@ -2,5 +2,5 @@ github "loudnate/LoopKit" ~> 0.3
github "loudnate/xDripG5" ~> 0.4
github "loudnate/SwiftCharts" "loudnate/naterade"
github "mddub/dexcom-share-client-swift" ~> 0.1
-github "ps2/rileylink_ios" ~> 0.3
+github "ps2/rileylink_ios" "dev"
github "mpurland/Amplitude-iOS" "framework"
diff --git a/Cartfile.resolved b/Cartfile.resolved
index 1e54dde2da..a112654877 100644
--- a/Cartfile.resolved
+++ b/Cartfile.resolved
@@ -3,5 +3,5 @@ github "loudnate/Crypto" "e0ef5b498f2c373d676135dabf5d1803b8558509"
github "loudnate/LoopKit" "v0.3.2"
github "loudnate/SwiftCharts" "448b80f4025bbf592a4d8ca9d079e9684bc0b64b"
github "mddub/dexcom-share-client-swift" "v0.1.0"
-github "ps2/rileylink_ios" "v0.3.0"
+github "ps2/rileylink_ios" "4305a83f897c19bd343c6b4f6fcdaaba0985ea64"
github "loudnate/xDripG5" "0.4.1"
diff --git a/Loop/Info.plist b/Loop/Info.plist
index 75aa0229cb..e3107628a2 100644
--- a/Loop/Info.plist
+++ b/Loop/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 1.0
+ 0.1.0
CFBundleSignature
????
CFBundleVersion
diff --git a/Loop/Managers/LoopDataManager.swift b/Loop/Managers/LoopDataManager.swift
index f4ab29ed84..f234d7baa2 100644
--- a/Loop/Managers/LoopDataManager.swift
+++ b/Loop/Managers/LoopDataManager.swift
@@ -516,15 +516,30 @@ class LoopDataManager {
return
}
- ops.setNormalBolus(units) { (error) in
- if let error = error {
- self.deviceDataManager.logger?.addError(error, fromSource: "Bolus")
+ ops.readRemainingInsulin { (result) in
+ switch result {
+ case .Success(let unitVolume):
+ self.deviceDataManager.doseStore.addReservoirValue(unitVolume, atDate: NSDate()) { (_, _, error) in
+ if let error = error {
+ self.deviceDataManager.logger?.addError(error, fromSource: "Bolus")
+ resultsHandler(success: false, error: .CommunicationError)
+ } else {
+ ops.setNormalBolus(units) { (error) in
+ if let error = error {
+ self.deviceDataManager.logger?.addError(error, fromSource: "Bolus")
+ resultsHandler(success: false, error: .CommunicationError)
+ } else {
+ self.lastBolus = (units: units, date: NSDate())
+ resultsHandler(success: true, error: nil)
+ }
+ self.notify()
+ }
+ }
+ }
+ case .Failure(let error):
+ self.deviceDataManager.logger?.addError(error, fromSource: "Bolus")
resultsHandler(success: false, error: .CommunicationError)
- } else {
- self.lastBolus = (units: units, date: NSDate())
-
- resultsHandler(success: true, error: nil)
}
}
}
diff --git a/LoopTests/Info.plist b/LoopTests/Info.plist
index ba72822e87..484c716a41 100644
--- a/LoopTests/Info.plist
+++ b/LoopTests/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- 1.0
+ 0.1.0
CFBundleSignature
????
CFBundleVersion
diff --git a/WatchApp Extension/Info.plist b/WatchApp Extension/Info.plist
index e54fcdc103..f6594eeb99 100644
--- a/WatchApp Extension/Info.plist
+++ b/WatchApp Extension/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageType
XPC!
CFBundleShortVersionString
- 1.0
+ 0.1.0
CFBundleSignature
????
CFBundleVersion
diff --git a/WatchApp/Info.plist b/WatchApp/Info.plist
index e57efd4a29..b6940e29d1 100644
--- a/WatchApp/Info.plist
+++ b/WatchApp/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 1.0
+ 0.1.0
CFBundleSignature
????
CFBundleVersion