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 {
|
impl TimeSheet {
|
||||||
pub fn open_or_create(path: &str) -> Self {
|
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 {
|
Self {
|
||||||
times: read_times(path).unwrap_or_else(|| vec![TimePoint::new("start")]),
|
times,
|
||||||
selected: 0,
|
selected,
|
||||||
register: None,
|
register: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user