mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-16 12:30:29 +00:00
Check for Pairing File
This commit is contained in:
parent
984a43ba47
commit
3550688545
1 changed files with 18 additions and 15 deletions
|
|
@ -21,24 +21,27 @@ struct HeartbeatApp: App {
|
|||
if isLoading {
|
||||
LoadingView()
|
||||
.onAppear {
|
||||
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { timer in
|
||||
if heartBeat {
|
||||
isLoading = false
|
||||
timer.invalidate()
|
||||
} else {
|
||||
if let error {
|
||||
if error == InvalidHostID.rawValue {
|
||||
isPairing = true
|
||||
} else {
|
||||
startHeartbeatInBackground()
|
||||
}
|
||||
self.error = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
startProxy()
|
||||
if FileManager.default.fileExists(atPath: URL.documentsDirectory.appendingPathComponent("pairingFile.plist").path) {
|
||||
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { timer in
|
||||
if heartBeat {
|
||||
isLoading = false
|
||||
timer.invalidate()
|
||||
} else {
|
||||
if let error {
|
||||
if error == InvalidHostID.rawValue {
|
||||
isPairing = true
|
||||
} else {
|
||||
startHeartbeatInBackground()
|
||||
}
|
||||
self.error = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
startHeartbeatInBackground()
|
||||
} else {
|
||||
isLoading = false
|
||||
}
|
||||
}
|
||||
.fileImporter(isPresented: $isPairing, allowedContentTypes: [UTType(filenameExtension: "mobiledevicepairing", conformingTo: .data)!, .propertyList]) {result in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue