(args) set content by given duration (#81)
This commit is contained in:
parent
c370d3096b
commit
44af71c01c
@ -1,8 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Features
|
||||
|
||||
- (args) set `content` by given duration [#81](https://github.com/sectore/tick-tock-tui/pull/81)
|
||||
|
||||
## v1.3.0 - 2025-05-06
|
||||
|
||||
### Features
|
||||
###
|
||||
|
||||
- (pomodoro) Count WORK rounds [#75](https://github.com/sectore/timr-tui/pull/75), [6b068bb](https://github.com/sectore/timr-tui/commit/6b068bbd094d9ec1a36b47598fadfc71296d9590)
|
||||
- (pomodoro/countdown) Change initial value [#79](https://github.com/sectore/timr-tui/pull/79), [aae5c38](https://github.com/sectore/timr-tui/commit/aae5c38cd6a666d5ba418b12fb67879a2146b9a2)
|
||||
|
||||
17
src/app.rs
17
src/app.rs
@ -92,7 +92,22 @@ impl From<FromAppArgs> for App {
|
||||
notification: args.notification.unwrap_or(stg.notification),
|
||||
blink: args.blink.unwrap_or(stg.blink),
|
||||
app_time_format: stg.app_time_format,
|
||||
content: args.mode.unwrap_or(stg.content),
|
||||
// Check args to set a possible mode to start with.
|
||||
content: match args.mode {
|
||||
Some(mode) => mode,
|
||||
// check other args (especially durations)
|
||||
None => {
|
||||
if args.work.is_some() || args.pause.is_some() {
|
||||
Content::Pomodoro
|
||||
} else if args.countdown.is_some() {
|
||||
Content::Countdown
|
||||
}
|
||||
// in other case just use latest stored state
|
||||
else {
|
||||
stg.content
|
||||
}
|
||||
}
|
||||
},
|
||||
style: args.style.unwrap_or(stg.style),
|
||||
pomodoro_mode: stg.pomodoro_mode,
|
||||
pomodoro_round: stg.pomodoro_count,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user