From 8162724328d75fb6b6032b940862baa68f0025d2 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Sun, 18 Feb 2024 00:49:56 +1300 Subject: [PATCH] Dont run timers once a plan is finished --- StartPlan.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/StartPlan.tsx b/StartPlan.tsx index eac1312..783798b 100644 --- a/StartPlan.tsx +++ b/StartPlan.tsx @@ -128,6 +128,8 @@ export default function StartPlan() { const canNotify = await check(PERMISSIONS.ANDROID.POST_NOTIFICATIONS); if (canNotify === RESULTS.DENIED) await request(PERMISSIONS.ANDROID.POST_NOTIFICATIONS); + if (isNaN(exercise.total) ? 0 : exercise.total === best.sets - 1 && selected === exercises.length - 1) + return NativeModules.AlarmModule.timer(milliseconds, `${exercise.name} (${exercise.total + 1}/${best.sets})`); };