PWD-3: add context menu to delete passwords
This commit is contained in:
parent
b8baca3461
commit
2376a1163d
1 changed files with 10 additions and 0 deletions
|
@ -62,6 +62,16 @@ struct ListView: View {
|
|||
.background(selectedItem == password.id ? .blue : .clear)
|
||||
.foregroundColor(selectedItem == password.id ? .white : (colorScheme == .dark ? .white : .black))
|
||||
.cornerRadius(8)
|
||||
.contextMenu {
|
||||
Button {
|
||||
selectedItem = nil
|
||||
viewModel.deletePassword(password)
|
||||
viewModel.passwords = viewModel.getAllPasswords()
|
||||
} label: {
|
||||
Label("Delete", systemImage: "trash")
|
||||
}
|
||||
.keyboardShortcut(.delete)
|
||||
}
|
||||
}
|
||||
|
||||
if isUpdateTextVisible {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue