check for profile already set before notification
This commit is contained in:
parent
aebaa76864
commit
a615553047
1 changed files with 7 additions and 7 deletions
|
@ -299,6 +299,13 @@ public class CommandQueue {
|
|||
|
||||
// returns true if command is queued
|
||||
public boolean setProfile(Profile profile, Callback callback) {
|
||||
if (isThisProfileSet(profile)) {
|
||||
log.debug("QUEUE: Correct profile already set");
|
||||
if (callback != null)
|
||||
callback.result(new PumpEnactResult().success(true).enacted(false)).run();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isRunning(Command.CommandType.BASALPROFILE)) {
|
||||
if (callback != null)
|
||||
callback.result(executingNowError()).run();
|
||||
|
@ -329,13 +336,6 @@ public class CommandQueue {
|
|||
|
||||
MainApp.bus().post(new EventDismissNotification(Notification.BASAL_VALUE_BELOW_MINIMUM));
|
||||
|
||||
if (isThisProfileSet(profile)) {
|
||||
log.debug("QUEUE: Correct profile already set");
|
||||
if (callback != null)
|
||||
callback.result(new PumpEnactResult().success(true).enacted(false)).run();
|
||||
return false;
|
||||
}
|
||||
|
||||
// remove all unfinished
|
||||
removeAll(Command.CommandType.BASALPROFILE);
|
||||
|
||||
|
|
Loading…
Reference in a new issue