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(',') =>
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue