Add Acknowledgement row to About page in settings

This commit is contained in:
Letro Bot
2026-05-04 23:32:03 +04:00
parent e418357988
commit f6e723edc3

View File

@@ -14,9 +14,7 @@ struct LegalInformationScreen: View {
let context: LegalInformationScreenViewModel.Context
@Environment(\.openURL) private var openURL
/*
Letro: open legal info in a sheet instead of external browser
*/
// Letro: Open legal info in a sheet instead of external browser
@State private var browserURL: BrowserURL?
var body: some View {
@@ -28,6 +26,9 @@ struct LegalInformationScreen: View {
kind: .button { browserURL = BrowserURL(context.viewState.acceptableUseURL) })
ListRow(label: .plain(title: L10n.commonPrivacyPolicy),
kind: .button { browserURL = BrowserURL(context.viewState.privacyURL) })
// Letro: Add Acknowledgement row
ListRow(label: .plain(title: "Acknowledgement"),
kind: .button { browserURL = BrowserURL(acknowledgementURL) })
}
}
.compoundList()
@@ -47,15 +48,19 @@ struct LegalInformationScreen: View {
}
}
}
}
/*
Letro: open legal info in a sheet instead of external browser
*/
private var acknowledgementURL: URL {
let version = InfoPlistReader.main.bundleShortVersionString
let baseURL = URL(string: "https://git.postnumber.com/letro/letro-authentication-service/releases/download/")!
return URL(string: "letro-v\(version)/sbom.json", relativeTo: baseURL)!.absoluteURL
}
}
private struct BrowserURL: Identifiable {
let url: URL
var id: URL { url }
var id: URL {
url
}
init(_ url: URL) {
self.url = url