Skip to content

Commit

Permalink
ui: workaround bug where pairing does not show
Browse files Browse the repository at this point in the history
  • Loading branch information
osy committed Jun 2, 2021
1 parent 48d5a3c commit 296a33d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Jitterbug/DeviceDetailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ struct DeviceDetailsView: View {
}.disabled(host.udid == nil)
}
}.onAppear {
selectedPairing = main.loadPairing(forHostName: host.hostname)
selectedSupportImage = main.loadDiskImage(forHostName: host.hostname)
selectedSupportImageSignature = main.loadDiskImageSignature(forHostName: host.hostname)
if selectedPairing == nil {
fileSelectType = .pairing
// BUG: sometimes SwiftUI doesn't like this...
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(1)) {
selectedPairing = main.loadPairing(forHostName: host.hostname)
selectedSupportImage = main.loadDiskImage(forHostName: host.hostname)
selectedSupportImageSignature = main.loadDiskImageSignature(forHostName: host.hostname)
if selectedPairing == nil {
fileSelectType = .pairing
}
}
}.onChange(of: selectedPairing) { url in
guard let selected = url else {
Expand Down

0 comments on commit 296a33d

Please sign in to comment.