Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 789793a

Browse files
authored
Fix a pesky bug
1 parent 968ff18 commit 789793a

1 file changed

Lines changed: 11 additions & 17 deletions

File tree

Sources/prosign/views/CertificateView.swift

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ struct Release: Codable, Identifiable, Equatable, Hashable {
2828
}
2929

3030
var publishedDate: Date {
31-
// Will be handled by decoder
3231
Date()
3332
}
3433
}
@@ -149,13 +148,11 @@ struct OfficialCertificatesView: View {
149148
}
150149
.navigationTitle("Official Certificates")
151150
.navigationBarTitleDisplayMode(.inline)
152-
.toolbar {
153-
ToolbarItem(placement: .navigationBarLeading) {
154-
Button("×") {
155-
dismiss()
156-
}
151+
.navigationBarItems(leading:
152+
Button("×") {
153+
dismiss()
157154
}
158-
}
155+
)
159156
.onAppear {
160157
fetchReleases()
161158
}
@@ -229,7 +226,6 @@ struct OfficialCertificatesView: View {
229226
let (data, response) = try await URLSession.shared.data(for: request)
230227
var decodeData = data
231228
if let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode != 200, pat != nil {
232-
// Fallback to unauthenticated
233229
let fallbackRequest = URLRequest(url: url)
234230
let (fallbackData, _) = try await URLSession.shared.data(for: fallbackRequest)
235231
decodeData = fallbackData
@@ -288,7 +284,6 @@ struct OfficialCertificatesView: View {
288284
var response = URLResponse()
289285
(tempData, response) = try await URLSession.shared.data(for: downloadRequest)
290286
if let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode != 200, pat != nil {
291-
// Fallback
292287
let fallbackRequest = URLRequest(url: downloadUrl)
293288
(tempData, _) = try await URLSession.shared.data(for: fallbackRequest)
294289
}
@@ -681,14 +676,13 @@ struct AddCertificateView: View {
681676
}
682677
.navigationTitle(editingCertificate != nil ? "Edit Certificate" : "New Certificate")
683678
.navigationBarTitleDisplayMode(.inline)
684-
.toolbar {
685-
ToolbarItem(placement: .navigationBarLeading) {
686-
Button("×") {
687-
dismiss()
688-
}
689-
.disabled(isChecking)
679+
.navigationBarItems(leading:
680+
Button("×") {
681+
dismiss()
690682
}
691-
ToolbarItem(placement: .navigationBarTrailing) {
683+
.disabled(isChecking)
684+
, trailing:
685+
Group {
692686
if isChecking {
693687
ProgressView()
694688
} else {
@@ -698,7 +692,7 @@ struct AddCertificateView: View {
698692
.disabled(p12File == nil || provFile == nil)
699693
}
700694
}
701-
}
695+
)
702696
.sheet(item: $activeSheet) { sheetType in
703697
CertificateDocumentPicker(kind: sheetType) { url in
704698
if sheetType == .p12 {

0 commit comments

Comments
 (0)