Check result.success when hard cancelling TBR.

(cherry picked from commit 654f984)
This commit is contained in:
Johannes Mockenhaupt 2018-02-07 15:23:29 +01:00
parent b435bb3cd5
commit 6fb5f5bad4
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -792,6 +792,9 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
if (enforceNew) { if (enforceNew) {
log.debug("cancelTempBasal: hard-cancelling TBR since force requested"); log.debug("cancelTempBasal: hard-cancelling TBR since force requested");
CommandResult commandResult = runCommand(MainApp.gs(R.string.combo_pump_action_cancelling_tbr), 2, ruffyScripter::cancelTbr); CommandResult commandResult = runCommand(MainApp.gs(R.string.combo_pump_action_cancelling_tbr), 2, ruffyScripter::cancelTbr);
if (!commandResult.success) {
return new PumpEnactResult().success(false).enacted(false);
}
if (!commandResult.state.tbrActive) { if (!commandResult.state.tbrActive) {
TemporaryBasal tempBasal = new TemporaryBasal(); TemporaryBasal tempBasal = new TemporaryBasal();
tempBasal.date = commandResult.state.timestamp; tempBasal.date = commandResult.state.timestamp;