~aleteoryx/muditaos

aa6203c5dc7f9246ec3ed69e0af51a59fde59515 — Tigran Soghbatyan 4 years ago 627304a
[BH-1135] Fix meditation app double bell

Prevent progress timer from triggering finish
and interval callbacks at once
1 files changed, 1 insertions(+), 1 deletions(-)

M module-apps/apps-common/widgets/ProgressTimer.cpp
M module-apps/apps-common/widgets/ProgressTimer.cpp => module-apps/apps-common/widgets/ProgressTimer.cpp +1 -1
@@ 54,6 54,7 @@ namespace app

    auto ProgressTimer::onTimerTimeout(sys::Timer &task) -> bool
    {
        ++elapsed;
        if (isStopped() || isFinished()) {
            task.stop();
            if (isFinished() && onFinishedCallback != nullptr) {


@@ 62,7 63,6 @@ namespace app
            return true;
        }

        ++elapsed;
        if ((intervalReached() || isFinished()) && onIntervalCallback != nullptr) {
            onIntervalCallback();
        }