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
59 lines
1.7 KiB
Swift
59 lines
1.7 KiB
Swift
import SwiftUI
|
|
import SecretKit
|
|
|
|
struct DeleteSecretView<StoreType: SecretStoreModifiable>: View {
|
|
|
|
@State var store: StoreType
|
|
let secret: StoreType.SecretType
|
|
var dismissalBlock: (Bool) -> ()
|
|
|
|
@State private var confirm = ""
|
|
|
|
var body: some View {
|
|
VStack {
|
|
HStack {
|
|
Image(nsImage: NSApplication.shared.applicationIconImage)
|
|
.resizable()
|
|
.frame(width: 64, height: 64)
|
|
.padding()
|
|
VStack {
|
|
HStack {
|
|
Text("delete_confirmation_title_\(secret.name)").bold()
|
|
Spacer()
|
|
}
|
|
HStack {
|
|
Text("delete_confirmation_description_\(secret.name)_\(secret.name)")
|
|
Spacer()
|
|
}
|
|
HStack {
|
|
Text("delete_confirmation_confirm_name_label")
|
|
TextField(secret.name, text: $confirm)
|
|
}
|
|
}
|
|
}
|
|
HStack {
|
|
Spacer()
|
|
Button("delete_confirmation_delete_button", action: delete)
|
|
.disabled(confirm != secret.name)
|
|
Button("delete_confirmation_cancel_button") {
|
|
dismissalBlock(false)
|
|
}
|
|
.keyboardShortcut(.cancelAction)
|
|
}
|
|
}
|
|
.padding()
|
|
.frame(minWidth: 400)
|
|
.onExitCommand {
|
|
dismissalBlock(false)
|
|
}
|
|
}
|
|
|
|
func delete() {
|
|
Task {
|
|
try! await store.delete(secret: secret)
|
|
dismissalBlock(true)
|
|
}
|
|
}
|
|
|
|
}
|