fix(cli): custom option tried to load the countdown duration

This commit is contained in:
Christoph J. Scherr 2024-07-12 15:46:09 +02:00 committed by PlexSheep
parent 265ac6c22c
commit 246cb9ed28
1 changed files with 4 additions and 8 deletions

View File

@ -154,7 +154,7 @@ impl Clock {
))) )))
} else if self.custom.is_some() { } else if self.custom.is_some() {
Some(TimeBarLength::Custom(i128::from( Some(TimeBarLength::Custom(i128::from(
self.countdown.unwrap().as_secs(), self.custom.unwrap().as_secs(),
))) )))
} else { } else {
None None
@ -325,7 +325,7 @@ impl Clock {
data: &UiData, data: &UiData,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
let clockw = tui_big_text::BigText::builder() let clockw = tui_big_text::BigText::builder()
.style(Style::new().red()) .style(Style::new().red().on_light_blue())
.lines(vec![data.ftime().into()]) .lines(vec![data.ftime().into()])
.alignment(Alignment::Center) .alignment(Alignment::Center)
.build() .build()
@ -356,12 +356,6 @@ impl Clock {
let ratio = data.timebar_ratio().unwrap(); let ratio = data.timebar_ratio().unwrap();
if !self.did_notify && (ratio - 1.0).abs() < 0.000_001 { if !self.did_notify && (ratio - 1.0).abs() < 0.000_001 {
if let Some(TimeBarLength::Countup(_)) = self.timebar_len() {}
let _ = self.notify().inspect_err(|e| {
error!("could not notify: {e}");
debug!("complete error: {e:#?}");
});
self.did_notify = true;
if let Some(TimeBarLength::Countup(_)) = self.timebar_len() { if let Some(TimeBarLength::Countup(_)) = self.timebar_len() {
let _ = self.notify().inspect_err(|e| { let _ = self.notify().inspect_err(|e| {
error!("could not notify: {e}"); error!("could not notify: {e}");
@ -382,6 +376,7 @@ impl Clock {
} else { } else {
Style::default().blue() Style::default().blue()
}) })
.on_cyan()
.unfilled_style(Style::default()) .unfilled_style(Style::default())
.block(Block::new().padding(Padding::new( .block(Block::new().padding(Padding::new(
parts[2].left() / 10, parts[2].left() / 10,
@ -399,6 +394,7 @@ impl Clock {
let datew = Paragraph::new(data.fdate()) let datew = Paragraph::new(data.fdate())
.blue() .blue()
.alignment(Alignment::Left) .alignment(Alignment::Left)
.on_gray()
.block(Block::new().padding(Padding::new( .block(Block::new().padding(Padding::new(
parts[1].left(), parts[1].left(),
parts[1].right() / 3, parts[1].right() / 3,