From f1ee15f09c93971d4125c4ca06de1cfb25d4a86b Mon Sep 17 00:00:00 2001 From: Young-do Cho Date: Tue, 22 Oct 2024 18:13:05 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B0=9C=EB=B0=9C=EC=8B=9C=20=EC=B4=88?= =?UTF-8?q?=EA=B3=BC=EC=8B=9C=EA=B0=84=EA=B9=8C=EC=A7=80=20=EB=B9=A0?= =?UTF-8?q?=EB=A5=B4=EA=B2=8C=20=ED=85=8C=EC=8A=A4=ED=8A=B8=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20=EC=9C=84=ED=95=9C=20=EC=B2=98=EB=A6=AC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20(#57)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/pages/pomodoro.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/renderer/pages/pomodoro.tsx b/src/renderer/pages/pomodoro.tsx index adedd2e..473c0c5 100644 --- a/src/renderer/pages/pomodoro.tsx +++ b/src/renderer/pages/pomodoro.tsx @@ -19,9 +19,14 @@ import { } from '@/shared/utils'; import { FocusScreen, HomeScreen, RestScreen, RestWaitScreen } from '@/widgets/pomodoro'; -const focusExceedMaxTime = minutesToMs(60); -const restWaitExceedMaxTime = minutesToMs(60); -const restExceedMaxTime = minutesToMs(30); +// @note: 개발할 때, 초과시간까지 빠르게 테스트하기 위해 설정함 +// 원래대로 하고 싶으면 false로 변경해서 사용하면 됩니다 +const isFastForward = import.meta.env.DEV; +const taping = (ms: number) => (isFastForward ? Math.floor(ms / 60) : ms); + +const focusExceedMaxTime = taping(minutesToMs(60)); +const restWaitExceedMaxTime = taping(minutesToMs(60)); +const restExceedMaxTime = taping(minutesToMs(30)); const timeoutMessageMap: Record< Exclude, @@ -56,8 +61,8 @@ const Pomodoro = () => { setCurrentCategory(categories?.[0]); }, [categories]); - const currentFocusTime = isoDurationToMs(currentCategory?.focusTime); - const currentRestTime = isoDurationToMs(currentCategory?.restTime); + const currentFocusTime = taping(isoDurationToMs(currentCategory?.focusTime)); + const currentRestTime = taping(isoDurationToMs(currentCategory?.restTime)); const { pomodoroCycles, pomodoroTime, startFocus, startRestWait, startRest, endPomodoro } = usePomodoro({