PWD-7: check for empty values before creation
This commit is contained in:
parent
737d904807
commit
083ca1f030
1 changed files with 10 additions and 0 deletions
|
@ -37,6 +37,16 @@ struct AddPasswordView: View {
|
|||
.font(.footnote)
|
||||
HStack {
|
||||
PwdButton(label: Text("Save")) {
|
||||
|
||||
if name.isEmpty || value.isEmpty {
|
||||
let alert = NSAlert()
|
||||
alert.messageText = "Missing values"
|
||||
alert.informativeText = "Make sure to fill in both name and value!"
|
||||
alert.addButton(withTitle: "Okay")
|
||||
alert.runModal()
|
||||
return
|
||||
}
|
||||
|
||||
viewModel.createPassword(name: name, value: value)
|
||||
name = ""
|
||||
value = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue