diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt index db3b2bf517..dce8c55206 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt @@ -136,8 +136,10 @@ class ConfigBuilderPlugin @Inject constructor( fun switchAllowed(changedPlugin: PluginBase, newState: Boolean, activity: FragmentActivity?, type: PluginType) { if (changedPlugin.getType() == PluginType.PUMP && changedPlugin.name != resourceHelper.gs(R.string.virtualpump)) confirmPumpPluginActivation(changedPlugin, newState, activity, type) - else if (changedPlugin.getType() == PluginType.PUMP) pumpSync.connectNewPump() - else performPluginSwitch(changedPlugin, newState, type) + else if (changedPlugin.getType() == PluginType.PUMP) { + performPluginSwitch(changedPlugin, newState, type) + pumpSync.connectNewPump() + } else performPluginSwitch(changedPlugin, newState, type) } private fun confirmPumpPluginActivation(changedPlugin: PluginBase, newState: Boolean, activity: FragmentActivity?, type: PluginType) {