fix(main): do not create empty notes
This commit is contained in:
parent
7ecfa6e810
commit
b26d64646c
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue