Make sure patch can be primed when already filled before activation

This commit is contained in:
jbr7rr 2023-06-08 22:22:42 +02:00
parent ecb2c977ec
commit 0ce25c1190

View file

@ -170,6 +170,11 @@ class MedtrumViewModel @Inject constructor(
} }
fun preparePatch() { fun preparePatch() {
// Make sure patch step is updated when already filled
// TODO: Maybe a nicer solution for this
if (medtrumPump.pumpState == MedtrumPumpState.FILLED) {
updateSetupStep(SetupStep.FILLED)
}
// New session, generate new session token, only do this when not connected // New session, generate new session token, only do this when not connected
if (medtrumService?.isConnected == false) { if (medtrumService?.isConnected == false) {
aapsLogger.info(LTag.PUMP, "preparePatch: new session") aapsLogger.info(LTag.PUMP, "preparePatch: new session")