forked from kageru/tracc
Open with the last timesheet item selected
This commit is contained in:
parent
a7696f34cc
commit
00647c4ddb
|
@ -72,9 +72,11 @@ fn effective_text(s: String) -> String {
|
|||
|
||||
impl TimeSheet {
|
||||
pub fn open_or_create(path: &str) -> Self {
|
||||
let times = read_times(path).unwrap_or_else(|| vec![TimePoint::new("start")]);
|
||||
let selected = times.len().saturating_sub(1);
|
||||
Self {
|
||||
times: read_times(path).unwrap_or_else(|| vec![TimePoint::new("start")]),
|
||||
selected: 0,
|
||||
times,
|
||||
selected,
|
||||
register: None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user