@@ -442,8 +442,8 @@ final class DeviceDataManager {
442
442
return pluginManager. availablePumpManagers + availableStaticPumpManagers
443
443
}
444
444
445
- func setupPumpManager( withIdentifier identifier: String , initialSettings settings: PumpManagerSetupSettings ) -> Swift . Result < SetupUIResult < PumpManagerViewController , PumpManager > , Error > {
446
- switch setupPumpManagerUI ( withIdentifier: identifier, initialSettings: settings) {
445
+ func setupPumpManager( withIdentifier identifier: String , initialSettings settings: PumpManagerSetupSettings , prefersToSkipUserInteraction : Bool ) -> Swift . Result < SetupUIResult < PumpManagerViewController , PumpManager > , Error > {
446
+ switch setupPumpManagerUI ( withIdentifier: identifier, initialSettings: settings, prefersToSkipUserInteraction : prefersToSkipUserInteraction ) {
447
447
case . failure( let error) :
448
448
return . failure( error)
449
449
case . success( let success) :
@@ -458,12 +458,12 @@ final class DeviceDataManager {
458
458
459
459
struct UnknownPumpManagerIdentifierError : Error { }
460
460
461
- func setupPumpManagerUI( withIdentifier identifier: String , initialSettings settings: PumpManagerSetupSettings ) -> Swift . Result < SetupUIResult < PumpManagerViewController , PumpManagerUI > , Error > {
461
+ func setupPumpManagerUI( withIdentifier identifier: String , initialSettings settings: PumpManagerSetupSettings , prefersToSkipUserInteraction : Bool = false ) -> Swift . Result < SetupUIResult < PumpManagerViewController , PumpManagerUI > , Error > {
462
462
guard let pumpManagerUIType = pumpManagerTypeByIdentifier ( identifier) else {
463
463
return . failure( UnknownPumpManagerIdentifierError ( ) )
464
464
}
465
465
466
- let result = pumpManagerUIType. setupViewController ( initialSettings: settings, bluetoothProvider: bluetoothProvider, colorPalette: . default, allowDebugFeatures: FeatureFlags . allowDebugFeatures, allowedInsulinTypes: allowedInsulinTypes)
466
+ let result = pumpManagerUIType. setupViewController ( initialSettings: settings, bluetoothProvider: bluetoothProvider, colorPalette: . default, allowDebugFeatures: FeatureFlags . allowDebugFeatures, prefersToSkipUserInteraction : prefersToSkipUserInteraction , allowedInsulinTypes: allowedInsulinTypes)
467
467
if case . createdAndOnboarded( let pumpManagerUI) = result {
468
468
pumpManagerOnboarding ( didCreatePumpManager: pumpManagerUI)
469
469
pumpManagerOnboarding ( didOnboardPumpManager: pumpManagerUI)
@@ -546,12 +546,12 @@ final class DeviceDataManager {
546
546
return availableCGMManagers
547
547
}
548
548
549
- func setupCGMManager( withIdentifier identifier: String ) -> Swift . Result < SetupUIResult < CGMManagerViewController , CGMManager > , Error > {
549
+ func setupCGMManager( withIdentifier identifier: String , prefersToSkipUserInteraction : Bool = false ) -> Swift . Result < SetupUIResult < CGMManagerViewController , CGMManager > , Error > {
550
550
if let cgmManager = setupCGMManagerFromPumpManager ( withIdentifier: identifier) {
551
551
return . success( . createdAndOnboarded( cgmManager) )
552
552
}
553
553
554
- switch setupCGMManagerUI ( withIdentifier: identifier) {
554
+ switch setupCGMManagerUI ( withIdentifier: identifier, prefersToSkipUserInteraction : prefersToSkipUserInteraction ) {
555
555
case . failure( let error) :
556
556
return . failure( error)
557
557
case . success( let success) :
@@ -566,12 +566,12 @@ final class DeviceDataManager {
566
566
567
567
struct UnknownCGMManagerIdentifierError : Error { }
568
568
569
- fileprivate func setupCGMManagerUI( withIdentifier identifier: String ) -> Swift . Result < SetupUIResult < CGMManagerViewController , CGMManagerUI > , Error > {
569
+ fileprivate func setupCGMManagerUI( withIdentifier identifier: String , prefersToSkipUserInteraction : Bool ) -> Swift . Result < SetupUIResult < CGMManagerViewController , CGMManagerUI > , Error > {
570
570
guard let cgmManagerUIType = cgmManagerTypeByIdentifier ( identifier) else {
571
571
return . failure( UnknownCGMManagerIdentifierError ( ) )
572
572
}
573
573
574
- let result = cgmManagerUIType. setupViewController ( bluetoothProvider: bluetoothProvider, displayGlucoseUnitObservable: displayGlucoseUnitObservable, colorPalette: . default, allowDebugFeatures: FeatureFlags . allowDebugFeatures)
574
+ let result = cgmManagerUIType. setupViewController ( bluetoothProvider: bluetoothProvider, displayGlucoseUnitObservable: displayGlucoseUnitObservable, colorPalette: . default, allowDebugFeatures: FeatureFlags . allowDebugFeatures, prefersToSkipUserInteraction : prefersToSkipUserInteraction )
575
575
if case . createdAndOnboarded( let cgmManagerUI) = result {
576
576
cgmManagerOnboarding ( didCreateCGMManager: cgmManagerUI)
577
577
cgmManagerOnboarding ( didOnboardCGMManager: cgmManagerUI)
0 commit comments