clock: fix play/pause

This commit is contained in:
🪞👃🪞 2025-05-09 23:22:28 +03:00
parent 9e8572ae0f
commit 5fa5a875b7
5 changed files with 21 additions and 22 deletions

View file

@ -29,11 +29,11 @@ impl ClockCommand {
state.pause_at(position)?;
Ok(None)
}
fn toggle_playback (state: &mut Clock, position: Option<u32>) -> Perhaps<Self> {
fn toggle_playback (state: &mut Clock, position: u32) -> Perhaps<Self> {
if state.is_rolling() {
state.pause_at(position)?;
state.pause_at(Some(position))?;
} else {
state.play_from(position)?;
state.play_from(Some(position))?;
}
Ok(None)
}