From 9e145d4d8f341e9c806ad3c11de576d7378d3ea1 Mon Sep 17 00:00:00 2001 From: Chris Sanden Date: Sat, 25 Apr 2026 17:22:55 +0200 Subject: [PATCH] wrote proposal for fetching timer after app has been exited / closed --- app/(tabs)/timer.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/(tabs)/timer.tsx b/app/(tabs)/timer.tsx index 89d3f69..12857f2 100644 --- a/app/(tabs)/timer.tsx +++ b/app/(tabs)/timer.tsx @@ -19,6 +19,18 @@ const colors = { text: '#ffffff', }; + +/* + TODO + Make timer count down even when app is un-focused or closed. + Set const endTime = Date.now() + duration and save that to the task, maybe? + Then trigger notif when endTime == Date.now()? + Then fetch endTime from DB -> if null then timer is inactive + if !null then set timer to endTime - Date.now() and start + Might have to save duration as well in DB to preserve timer animation persistance +*/ + + const TIMER_OPTIONS = [...Array(13).keys()].map((index) => (index === 0 ? 1 : index * 5)); const ITEM_SIZE = width * 0.38; const ITEM_SPACING = (width - ITEM_SIZE) / 2;