fix double treatment upload from wizard
This commit is contained in:
parent
6c9c0d8223
commit
d85bb7db4d
2 changed files with 12 additions and 2 deletions
|
@ -337,7 +337,17 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
||||||
insulin = applyBolusConstraints(insulin);
|
insulin = applyBolusConstraints(insulin);
|
||||||
carbs = applyCarbsConstraints(carbs);
|
carbs = applyCarbsConstraints(carbs);
|
||||||
|
|
||||||
PumpEnactResult result = deliverTreatment(insulin, carbs, context);
|
BolusProgressDialog bolusProgressDialog = null;
|
||||||
|
if (context != null) {
|
||||||
|
bolusProgressDialog = new BolusProgressDialog(insulin);
|
||||||
|
bolusProgressDialog.show(((AppCompatActivity) context).getSupportFragmentManager(), "BolusProgress");
|
||||||
|
}
|
||||||
|
|
||||||
|
PumpEnactResult result = activePump.deliverTreatment(insulin, carbs, context);
|
||||||
|
|
||||||
|
if (bolusProgressDialog != null) {
|
||||||
|
bolusProgressDialog.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
if (Config.logCongigBuilderActions)
|
if (Config.logCongigBuilderActions)
|
||||||
log.debug("deliverTreatmentFromBolusWizard insulin: " + insulin + " carbs: " + carbs + " success: " + result.success + " enacted: " + result.enacted + " bolusDelivered: " + result.bolusDelivered);
|
log.debug("deliverTreatmentFromBolusWizard insulin: " + insulin + " carbs: " + carbs + " success: " + result.success + " enacted: " + result.enacted + " bolusDelivered: " + result.bolusDelivered);
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class WizardDialog extends DialogFragment implements OnClickListener {
|
||||||
Context parentContext;
|
Context parentContext;
|
||||||
|
|
||||||
public WizardDialog(Context context) {
|
public WizardDialog(Context context) {
|
||||||
mHandlerThread = new HandlerThread(NewExtendedBolusDialog.class.getSimpleName());
|
mHandlerThread = new HandlerThread(WizardDialog.class.getSimpleName());
|
||||||
mHandlerThread.start();
|
mHandlerThread.start();
|
||||||
mHandler = new Handler(mHandlerThread.getLooper());
|
mHandler = new Handler(mHandlerThread.getLooper());
|
||||||
parentContext = context;
|
parentContext = context;
|
||||||
|
|
Loading…
Reference in a new issue