Merge pull request #935 from jotomo/calculator-carb-only

Calculator: carb-only handling.
This commit is contained in:
AdrianLxM 2018-04-28 19:29:13 +02:00 committed by GitHub
commit 81037cde5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -801,6 +801,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
detailedBolusInfo.context = context;
detailedBolusInfo.boluscalc = boluscalcJSON;
detailedBolusInfo.source = Source.USER;
if (finalInsulinAfterConstraints > 0 || ConfigBuilderPlugin.getActivePump().getPumpDescription().storesCarbInfo) {
ConfigBuilderPlugin.getCommandQueue().bolus(detailedBolusInfo, new Callback() {
@Override
public void run() {
@ -814,6 +815,9 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
}
});
} else {
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo);
}
FabricPrivacy.getInstance().logCustom(new CustomEvent("QuickWizard"));
}
}