fix double treatment upload from wizard

This commit is contained in:
Milos Kozak 2016-08-13 12:47:15 +02:00
parent 6c9c0d8223
commit d85bb7db4d
2 changed files with 12 additions and 2 deletions

View file

@ -337,7 +337,17 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
insulin = applyBolusConstraints(insulin);
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)
log.debug("deliverTreatmentFromBolusWizard insulin: " + insulin + " carbs: " + carbs + " success: " + result.success + " enacted: " + result.enacted + " bolusDelivered: " + result.bolusDelivered);

View file

@ -83,7 +83,7 @@ public class WizardDialog extends DialogFragment implements OnClickListener {
Context parentContext;
public WizardDialog(Context context) {
mHandlerThread = new HandlerThread(NewExtendedBolusDialog.class.getSimpleName());
mHandlerThread = new HandlerThread(WizardDialog.class.getSimpleName());
mHandlerThread.start();
mHandler = new Handler(mHandlerThread.getLooper());
parentContext = context;