fix(countdown): Reset MET if countdown is set by cli arguments (#71)

* fix: Reset MET if countdown is set by args

* update CHANGELOG
This commit is contained in:
Jens Krause 2025-03-03 12:21:17 +01:00 committed by GitHub
parent ffad78e093
commit d9399eafc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -2,6 +2,10 @@
## [Unreleased]
### Fixes
(countdown) Reset `Mission Elapsed Time (MET)` if `countdown` is set by cli arguments [#71](https://github.com/sectore/timr-tui/pull/71)
### Misc.
(cargo) Exclude files for packaging [e7a5a1b](https://github.com/sectore/timr-tui/commit/e7a5a1b2da7a7967f2602a0b92f391ac768ca638)

View File

@ -103,7 +103,11 @@ impl From<FromAppArgs> for App {
initial_value_countdown: args.countdown.unwrap_or(stg.inital_value_countdown),
// invalidate `current_value_countdown` if an initial value is set via args
current_value_countdown: args.countdown.unwrap_or(stg.current_value_countdown),
elapsed_value_countdown: stg.elapsed_value_countdown,
elapsed_value_countdown: match args.countdown {
// reset value if countdown is set by arguments
Some(_) => Duration::ZERO,
None => stg.elapsed_value_countdown,
},
current_value_timer: stg.current_value_timer,
app_tx,
#[cfg(feature = "sound")]