mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-08-19 11:40:56 +00:00
* Enable language mode
* WIP
* WIP
* Fix concurrency issues in SmartCardStore
* Switch to SMAppService
* Bump runners
* Base
* Finish Testing migration
* Tweak async for updater
* More
* Backport mutex
* Revert "Backport mutex"
This reverts commit 9b02afb20c
.
* WIP
* Reenable
* Fix preview.
* Update package.
* Bump to latest public macOS and Xcode
* Bump back down to 6.1
* Update to Xcode 26.
* Fixed tests.
* More cleanup
* Env fixes
* var->let
* Cleanup
* Persist auth async
* Whitespace.
* Whitespace.
* Cleanup.
* Cleanup
* Redoing locks in actors bc of observable
* Actors.
* .
* Specify b5
* Update package to 6.2
* Fix disabled updater
* Remove preconcurrency warning
* Move updater init
64 lines
1.9 KiB
Swift
64 lines
1.9 KiB
Swift
import SwiftUI
|
|
import Brief
|
|
|
|
struct UpdateDetailView: View {
|
|
|
|
@Environment(\.updater) var updater: any UpdaterProtocol
|
|
|
|
let update: Release
|
|
|
|
var body: some View {
|
|
VStack {
|
|
Text("update_version_name_\(update.name)").font(.title)
|
|
GroupBox(label: Text("update_release_notes_title")) {
|
|
ScrollView {
|
|
attributedBody
|
|
}
|
|
}
|
|
HStack {
|
|
if !update.critical {
|
|
Button("update_ignore_button") {
|
|
Task {
|
|
await updater.ignore(release: update)
|
|
}
|
|
}
|
|
Spacer()
|
|
}
|
|
Button("update_update_button") {
|
|
NSWorkspace.shared.open(update.html_url)
|
|
}
|
|
.keyboardShortcut(.defaultAction)
|
|
}
|
|
|
|
}
|
|
.padding()
|
|
.frame(maxWidth: 500)
|
|
}
|
|
|
|
var attributedBody: Text {
|
|
var text = Text(verbatim: "")
|
|
for line in update.body.split(whereSeparator: \.isNewline) {
|
|
let attributed: Text
|
|
let split = line.split(separator: " ")
|
|
let unprefixed = split.dropFirst().joined(separator: " ")
|
|
if let prefix = split.first {
|
|
switch prefix {
|
|
case "#":
|
|
attributed = Text(unprefixed).font(.title) + Text(verbatim: "\n")
|
|
case "##":
|
|
attributed = Text(unprefixed).font(.title2) + Text(verbatim: "\n")
|
|
case "###":
|
|
attributed = Text(unprefixed).font(.title3) + Text(verbatim: "\n")
|
|
default:
|
|
attributed = Text(line) + Text(verbatim: "\n\n")
|
|
}
|
|
} else {
|
|
attributed = Text(line) + Text(verbatim: "\n\n")
|
|
}
|
|
text = text + attributed
|
|
}
|
|
return text
|
|
}
|
|
|
|
}
|