forked from janek/mostr
1
0
Fork 0

fix(main): fallback when listing empty description

This commit is contained in:
xeruf 2024-11-10 20:20:34 +01:00
parent 60b33b1dd3
commit d5e6bd2578
1 changed files with 7 additions and 9 deletions

View File

@ -448,20 +448,18 @@ async fn main() -> Result<()> {
Some(',') =>
match arg {
None => {
match tasks.get_current_task() {
None => {
info!("With a task selected, use ,NOTE to attach NOTE and , to list all its notes");
tasks.recurse_activities = !tasks.recurse_activities;
info!("Toggled activities recursion to {}", tasks.recurse_activities);
}
Some(task) => {
if let Some(task) = tasks.get_current_task() {
let mut desc = task.description_events().peekable();
if desc.peek().is_some() {
println!("{}",
task.description_events()
.map(|e| format!("{} {}", format_timestamp_local(&e.created_at), e.content))
desc.map(|e| format!("{} {}", format_timestamp_local(&e.created_at), e.content))
.join("\n"));
continue 'repl;
}
}
info!("With a task selected, use ,NOTE to attach NOTE and , to list all its notes");
tasks.recurse_activities = !tasks.recurse_activities;
info!("Toggled activities recursion to {}", tasks.recurse_activities);
}
Some(arg) => {
if arg.len() < CHARACTER_THRESHOLD {