Skip to content

Commit 23d2c84

Browse files
committed
type needs to be bolus
1 parent 184ea75 commit 23d2c84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Loop/Views/Insulin Delivery Log/InsulinDeliveryLogViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class InsulinDeliveryLogViewModel {
239239
}
240240

241241
private func fetchLastAutoBolus(doses: [DoseEntry]) -> DatedQuantity? {
242-
guard let lastAutoBolusDose = doses.last(where: { $0.automatic == true }) else {
242+
guard let lastAutoBolusDose = doses.last(where: { $0.type == .bolus && $0.automatic == true }) else {
243243
return nil
244244
}
245245

0 commit comments

Comments
 (0)