@@ -10,16 +10,11 @@ import os.log
10
10
import Foundation
11
11
import LoopKit
12
12
import LoopKitUI
13
- import TidepoolSupport
14
13
15
14
class PluginManager {
16
15
let pluginBundles : [ Bundle ]
17
16
18
17
private let log = OSLog ( category: " PluginManager " )
19
-
20
- private var selectedProduct : TidepoolSupport . Product {
21
- TidepoolSupport . Product ( rawValue: UserDefaults . appGroup? . productSelection ?? " none " ) ?? . none
22
- }
23
18
24
19
public init ( pluginsURL: URL ? = Bundle . main. privateFrameworksURL) {
25
20
var bundles = [ Bundle] ( )
@@ -69,18 +64,14 @@ class PluginManager {
69
64
}
70
65
71
66
var availablePumpManagers : [ PumpManagerDescriptor ] {
72
- if selectedProduct. maskDevices {
73
- return [ ]
74
- } else {
75
- return pluginBundles. compactMap ( { ( bundle) -> PumpManagerDescriptor ? in
76
- guard let title = bundle. object ( forInfoDictionaryKey: LoopPluginBundleKey . pumpManagerDisplayName. rawValue) as? String ,
77
- let identifier = bundle. object ( forInfoDictionaryKey: LoopPluginBundleKey . pumpManagerIdentifier. rawValue) as? String else {
78
- return nil
79
- }
80
-
81
- return PumpManagerDescriptor ( identifier: identifier, localizedTitle: title)
82
- } )
83
- }
67
+ pluginBundles. compactMap ( { ( bundle) -> PumpManagerDescriptor ? in
68
+ guard let title = bundle. object ( forInfoDictionaryKey: LoopPluginBundleKey . pumpManagerDisplayName. rawValue) as? String ,
69
+ let identifier = bundle. object ( forInfoDictionaryKey: LoopPluginBundleKey . pumpManagerIdentifier. rawValue) as? String else {
70
+ return nil
71
+ }
72
+
73
+ return PumpManagerDescriptor ( identifier: identifier, localizedTitle: title)
74
+ } )
84
75
}
85
76
86
77
func getCGMManagerTypeByIdentifier( _ identifier: String ) -> CGMManagerUI . Type ? {
@@ -109,18 +100,14 @@ class PluginManager {
109
100
}
110
101
111
102
var availableCGMManagers : [ CGMManagerDescriptor ] {
112
- if selectedProduct. maskDevices {
113
- return [ ]
114
- } else {
115
- return pluginBundles. compactMap ( { ( bundle) -> CGMManagerDescriptor ? in
116
- guard let title = bundle. object ( forInfoDictionaryKey: LoopPluginBundleKey . cgmManagerDisplayName. rawValue) as? String ,
117
- let identifier = bundle. object ( forInfoDictionaryKey: LoopPluginBundleKey . cgmManagerIdentifier. rawValue) as? String else {
118
- return nil
119
- }
120
-
121
- return CGMManagerDescriptor ( identifier: identifier, localizedTitle: title)
122
- } )
123
- }
103
+ pluginBundles. compactMap ( { ( bundle) -> CGMManagerDescriptor ? in
104
+ guard let title = bundle. object ( forInfoDictionaryKey: LoopPluginBundleKey . cgmManagerDisplayName. rawValue) as? String ,
105
+ let identifier = bundle. object ( forInfoDictionaryKey: LoopPluginBundleKey . cgmManagerIdentifier. rawValue) as? String else {
106
+ return nil
107
+ }
108
+
109
+ return CGMManagerDescriptor ( identifier: identifier, localizedTitle: title)
110
+ } )
124
111
}
125
112
126
113
func getServiceTypeByIdentifier( _ identifier: String ) -> ServiceUI . Type ? {
0 commit comments