fix(main): do not create empty notes

This commit is contained in:
xeruf 2024-11-23 12:11:31 +01:00
parent 7ecfa6e810
commit b26d64646c
2 changed files with 4 additions and 5 deletions

View File

@ -417,8 +417,8 @@ async fn main() -> Result<()> {
}
}
Some(arg) => {
if arg.len() < CHARACTER_THRESHOLD {
warn!("Note needs at least {CHARACTER_THRESHOLD} characters!");
if arg.trim().len() < 2 {
warn!("Needs at least 2 characters!");
continue 'repl;
}
tasks.make_note(arg);

View File

@ -1316,9 +1316,8 @@ impl TasksRelay {
let (name, tags) = extract_tags(note.trim());
let format = format!("\"{name}\" with tags [{}]", join_tags(&tags));
let mut prop =
EventBuilder::new(Kind::TextNote, name).tags(tags);
//.filter(|id| self.get_by_id(id).is_some_and(|t| t.is_task()))
//.map(|id|
EventBuilder::new(Kind::TextNote, name)
.tags(tags);
let marker =
if self.get_current_task().is_some_and(|t| t.is_task()) {
MARKER_PROPERTY