From 12f9352f69a5a006bc891842b1878e0733350695 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Fri, 8 Jul 2022 11:18:45 -0500 Subject: [PATCH] Fix starting new timer --- .../main/java/com/todoroo/astrid/timers/TimerControlSet.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/todoroo/astrid/timers/TimerControlSet.kt b/app/src/main/java/com/todoroo/astrid/timers/TimerControlSet.kt index d741f4d34..3e186f70a 100644 --- a/app/src/main/java/com/todoroo/astrid/timers/TimerControlSet.kt +++ b/app/src/main/java/com/todoroo/astrid/timers/TimerControlSet.kt @@ -114,9 +114,10 @@ class TimerControlSet : TaskEditControlComposeFragment() { stringResource(id = R.string.TEA_timer_est, DateUtils.formatElapsedTime(it.toLong())) } val elapsed = - viewModel.elapsedSeconds.collectAsStateLifecycleAware().value.takeIf { it > 0 } + (newElapsed + viewModel.elapsedSeconds.collectAsStateLifecycleAware().value) + .takeIf { it > 0 } ?.let { - stringResource(id = R.string.TEA_timer_elap, DateUtils.formatElapsedTime(it + newElapsed)) + stringResource(id = R.string.TEA_timer_elap, DateUtils.formatElapsedTime(it)) } val text = when { estimated != null && elapsed != null -> "$estimated, $elapsed"