Fix rest timers for new sets from homepage

This commit is contained in:
Brandon Presley 2022-11-03 22:16:18 +13:00
parent 0e5de0e519
commit 29d14d74ff
1 changed files with 3 additions and 2 deletions

View File

@ -30,8 +30,9 @@ export default function EditSet() {
const startTimer = useCallback(
async (name: string) => {
if (!settings.alarm) return
const {minutes, seconds} = await setRepo.findOne({where: {name}})
const milliseconds = (minutes ?? 3) * 60 * 1000 + (seconds ?? 0) * 1000
const first = await setRepo.findOne({where: {name}})
const milliseconds =
(first?.minutes ?? 3) * 60 * 1000 + (first?.seconds ?? 0) * 1000
NativeModules.AlarmModule.timer(
milliseconds,
settings.vibrate,