From 60a41b7dce3c295656268509549e011493454506 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 26 May 2017 15:02:59 +0200 Subject: [PATCH] switch order of commands when setting superbolus --- .../androidaps/plugins/Overview/Dialogs/WizardDialog.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java index 2235bbe1dd..7fca658695 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java @@ -330,6 +330,10 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Co } if (useSuperBolus) { final LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop(); + if (activeloop != null) { + activeloop.superBolusTo(new Date().getTime() + 2 * 60L * 60 * 1000); + MainApp.bus().post(new EventRefreshGui(false)); + } result = pump.setTempBasalAbsolute(0d, 120); if (!result.success) { AlertDialog.Builder builder = new AlertDialog.Builder(context); @@ -338,10 +342,6 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Co builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null); builder.show(); } - if (activeloop != null) { - activeloop.superBolusTo(new Date().getTime() + 2 * 60L * 60 * 1000); - MainApp.bus().post(new EventRefreshGui(false)); - } } } });