forked from janek/mostr
fix: more intuitive feedback when stopping timetracking
This commit is contained in:
parent
84e46827ce
commit
a0f5d62c81
|
@ -574,10 +574,12 @@ async fn main() -> Result<()> {
|
|||
match arg {
|
||||
None => tasks.move_to(None),
|
||||
Some(arg) => {
|
||||
if parse_tracking_stamp(arg).map(|stamp| tasks.track_at(stamp, None)).is_none() {
|
||||
// So the error message is not covered up
|
||||
continue;
|
||||
if parse_tracking_stamp(arg).map(|stamp| tasks.track_at(stamp, None)).is_some() {
|
||||
let (label, times) = tasks.times_tracked();
|
||||
println!("{}\n{}", label.italic(), times.rev().take(15).join("\n"));
|
||||
}
|
||||
// So the error message is not covered up
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -735,7 +735,9 @@ impl Tasks {
|
|||
}
|
||||
|
||||
pub(crate) fn track_at(&mut self, time: Timestamp, task: Option<EventId>) -> EventId {
|
||||
info!("{} from {}", task.map_or(String::from("Stopping time-tracking"), |id| format!("Tracking \"{}\"", self.get_task_title(&id))), format_timestamp_relative(&time));
|
||||
info!("{} {}", task.map_or(
|
||||
String::from("Stopping time-tracking at"),
|
||||
|id| format!("Tracking \"{}\" from", self.get_task_title(&id))), format_timestamp_relative(&time));
|
||||
self.submit(
|
||||
build_tracking(task)
|
||||
.custom_created_at(time)
|
||||
|
|
Loading…
Reference in New Issue