Remove next pod address after succesful pairing

This commit is contained in:
Bart Sopers 2020-05-03 13:43:06 +02:00
parent e01ac6f6be
commit b676638942

View file

@ -177,6 +177,9 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
Disposable disposable = delegate.pairAndPrime(address).subscribe(res -> //
handleSetupActionResult(podInitActionType, podInitReceiver, res, time, null));
removeNextPodAddress();
return new PumpEnactResult().success(true).enacted(true);
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
@ -582,6 +585,11 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
return nextPodAddress;
}
private void removeNextPodAddress() {
nextPodAddress = null;
OmnipodUtil.removeNextPodAddress();
}
private void handleSetupActionResult(PodInitActionType podInitActionType, PodInitReceiver podInitReceiver, SetupActionResult res, long time, Profile profile) {
String comment = null;
switch (res.getResultType()) {