diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 067e37e3..1a898191 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -332,7 +332,7 @@ namespace modules { } /** - * Subthread runner that emit update events to refresh + * Subthread runner that emits update events to refresh * or in case they are used. Note, that it is ok to * use a single thread, because the two animations are never shown at the * same time. @@ -340,9 +340,9 @@ namespace modules { void battery_module::subthread() { chrono::duration dur{0.0}; - if (m_animation_charging) { + if (battery_module::state::CHARGING == m_state && m_animation_charging) { dur += chrono::milliseconds{m_animation_charging->framerate()}; - } else if (m_animation_discharging) { + } else if (battery_module::state::DISCHARGING == m_state && m_animation_discharging) { dur += chrono::milliseconds{m_animation_discharging->framerate()}; } else { dur += 1s;