Skip to content

Commit f20e048

Browse files
committed
ble: fix watch reconnecting immediately after disconnect
1 parent 1f7d63a commit f20e048

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

InfiniLink/BLE/BLEManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
279279
isConnectedToPinetime = false
280280
notifyCharacteristic = nil
281281

282-
if pairedDeviceID != nil, pairedDeviceID == peripheral.identifier.uuidString {
282+
if pairedDeviceID != nil, pairedDeviceID == peripheral.identifier.uuidString && error == nil {
283283
connect(peripheral: peripheral) {}
284284
} else if let error {
285285
log(error.localizedDescription, caller: "didDisconnectPeripheral", target: .ble)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// StepChartView.swift
3+
// InfiniLink
4+
//
5+
// Created by Liam Willey on 1/11/25.
6+
//
7+
8+
import SwiftUI
9+
10+
struct StepChartView: View {
11+
var body: some View {
12+
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
13+
}
14+
}
15+
16+
#Preview {
17+
StepChartView()
18+
}

0 commit comments

Comments
 (0)