Implement note editing

This commit is contained in:
2024-03-07 20:15:01 -05:00
parent c0d141a02e
commit 80f1e27507
4 changed files with 92 additions and 54 deletions
+3 -10
View File
@@ -30,23 +30,16 @@ func AddEntry(targetLocation string, hidePassword bool, entryType uint8) {
url := input("URL:")
if inputBinary("Add a note to this entry?") {
note := newNote()
note, _ := editNote([]string{})
unencryptedEntry = append([]string{password, username, url}, note...)
} else {
unencryptedEntry = []string{password, username, url}
}
} else {
note := newNote()
note, _ := editNote([]string{})
unencryptedEntry = append([]string{"", "", ""}, note...)
}
// write and preview the new entry
if offline.EntryIsNotEmpty(unencryptedEntry) {
offline.WriteEntry(targetLocation, unencryptedEntry)
fmt.Println(ansiBold + "\nEntry Preview:" + offline.AnsiReset)
EntryReader(unencryptedEntry, hidePassword)
} else {
fmt.Println(offline.AnsiError + "No data supplied for entry" + offline.AnsiReset)
os.Exit(1)
}
writeEntryShortcut(targetLocation, unencryptedEntry, hidePassword)
}