File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,9 +150,13 @@ public class BleClientManager : NSObject {
150150
151151 _ = manager. monitorDisconnection ( for: peripheral)
152152 . take ( 1 )
153- . subscribe ( onNext: { [ weak self] peripheral in
154- self ? . onPeripheralDisconnected ( peripheral)
155- } )
153+ . subscribe (
154+ onNext: { [ weak self] peripheral in
155+ self ? . onPeripheralDisconnected ( peripheral)
156+ } ,
157+ onError: { [ weak self] error in
158+ self ? . onPeripheralDisconnected ( peripheral)
159+ } )
156160
157161 peripheral. services? . forEach { service in
158162 discoveredServices [ service. jsIdentifier] = service
@@ -278,6 +282,8 @@ public class BleClientManager : NSObject {
278282 . subscribe ( onNext: { peripheral in
279283 // We are monitoring peripheral disconnections to clean up state.
280284 self ? . onPeripheralDisconnected ( peripheral)
285+ } , onError: { error in
286+ self ? . onPeripheralDisconnected ( device)
281287 } )
282288 promise. resolve ( device. asJSObject ( ) )
283289 } else {
You can’t perform that action at this time.
0 commit comments