forked from janek/mostr
fix(main): fallback when listing empty description
This commit is contained in:
parent
60b33b1dd3
commit
d5e6bd2578
16
src/main.rs
16
src/main.rs
|
@ -448,20 +448,18 @@ async fn main() -> Result<()> {
|
||||||
Some(',') =>
|
Some(',') =>
|
||||||
match arg {
|
match arg {
|
||||||
None => {
|
None => {
|
||||||
match tasks.get_current_task() {
|
if let Some(task) = tasks.get_current_task() {
|
||||||
None => {
|
let mut desc = task.description_events().peekable();
|
||||||
info!("With a task selected, use ,NOTE to attach NOTE and , to list all its notes");
|
if desc.peek().is_some() {
|
||||||
tasks.recurse_activities = !tasks.recurse_activities;
|
|
||||||
info!("Toggled activities recursion to {}", tasks.recurse_activities);
|
|
||||||
}
|
|
||||||
Some(task) => {
|
|
||||||
println!("{}",
|
println!("{}",
|
||||||
task.description_events()
|
desc.map(|e| format!("{} {}", format_timestamp_local(&e.created_at), e.content))
|
||||||
.map(|e| format!("{} {}", format_timestamp_local(&e.created_at), e.content))
|
|
||||||
.join("\n"));
|
.join("\n"));
|
||||||
continue 'repl;
|
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) => {
|
Some(arg) => {
|
||||||
if arg.len() < CHARACTER_THRESHOLD {
|
if arg.len() < CHARACTER_THRESHOLD {
|
||||||
|
|
Loading…
Reference in New Issue