From 883c2322d25d612a1e7bf146d57294a4e16e0c93 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Thu, 14 Oct 2021 22:09:13 +0200 Subject: [PATCH] nicer --- .../action/DashInsertCannulaViewModel.kt | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt index a4e413e7ae..e372e1528b 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt @@ -65,13 +65,9 @@ class DashInsertCannulaViewModel @Inject constructor( null super.disposable += omnipodManager.activatePodPart2(basalProgram, expirationHoursBeforeShutdown) + .ignoreElements() + .andThen(podStateManager.updateExpirationAlertSettings(expirationReminderEnabled, expirationHours)) .subscribeBy( - onNext = { podEvent -> - logger.debug( - LTag.PUMP, - "Received PodEvent in Pod activation part 2: $podEvent" - ) - }, onError = { throwable -> logger.error(LTag.PUMP, "Error in Pod activation part 2", throwable) source.onSuccess(PumpEnactResult(injector).success(false).comment(I8n.textFromException(throwable, resourceHelper))) @@ -103,14 +99,6 @@ class DashInsertCannulaViewModel @Inject constructor( pumpSerial = podStateManager.uniqueId?.toString() ?: "n/a" ) - val err = podStateManager.updateExpirationAlertSettings( - expirationReminderEnabled, - expirationHours - ) - .blockingGet() - err?.let { - logger.warn(LTag.PUMP, "Error updating local alert settings: $err") - } rxBus.send(EventDismissNotification(Notification.OMNIPOD_POD_NOT_ATTACHED)) source.onSuccess(PumpEnactResult(injector).success(true)) }