From 861b5df9f41234bc4782e1b20ce6fc209e486a26 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Fri, 14 Oct 2022 16:57:08 +1300 Subject: [PATCH] Remove extra padding from workouts rest timers Typically rest timers don't have double digit minutes. This doesn't prevent that, but will save space 99% of the time, and in the odd situation where a rest duration is >9 minutes will be slightly uneven. --- WorkoutItem.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/WorkoutItem.tsx b/WorkoutItem.tsx index 5e382bd..814140f 100644 --- a/WorkoutItem.tsx +++ b/WorkoutItem.tsx @@ -36,9 +36,8 @@ export default function WorkoutItem({ ); const description = useMemo(() => { - const minutes = item.minutes?.toString().padStart(2, '0'); const seconds = item.seconds?.toString().padStart(2, '0'); - if (settings.alarm) return `${item.sets} x ${minutes}:${seconds}`; + if (settings.alarm) return `${item.sets} x ${item.minutes || 0}:${seconds}`; return `${item.sets}`; }, [item, settings.alarm]);