diff --git a/app/renderer/src/contexts/CounterContext.tsx b/app/renderer/src/contexts/CounterContext.tsx index 0f76c46a..9e9f9c96 100644 --- a/app/renderer/src/contexts/CounterContext.tsx +++ b/app/renderer/src/contexts/CounterContext.tsx @@ -50,9 +50,9 @@ const CounterProvider: React.FC = ({ children }) => { const [shouldFullscreen, setShouldFullscreen] = useState(false); - const [count, setCount] = useState(config.stayFocused * 60); + const [count, setCount] = useState(config.stayFocus * 60); - const [duration, setDuration] = useState(config.stayFocused * 60); + const [duration, setDuration] = useState(config.stayFocus * 60); const setTimerDuration = useCallback((time: number) => { setDuration(time * 60); @@ -62,7 +62,7 @@ const CounterProvider: React.FC = ({ children }) => { const resetTimerAction = useCallback(() => { switch (timer.timerType) { case TimerStatus.STAY_FOCUS: - setTimerDuration(config.stayFocused); + setTimerDuration(config.stayFocus); break; case TimerStatus.SHORT_BREAK: setTimerDuration(config.shortBreak); @@ -77,7 +77,7 @@ const CounterProvider: React.FC = ({ children }) => { } }, [ config.longBreak, - config.stayFocused, + config.stayFocus, config.shortBreak, timer.timerType, duration, @@ -192,7 +192,7 @@ const CounterProvider: React.FC = ({ children }) => { useEffect(() => { switch (timer.timerType) { case TimerStatus.STAY_FOCUS: - setTimerDuration(config.stayFocused); + setTimerDuration(config.stayFocus); break; case TimerStatus.SHORT_BREAK: setTimerDuration(config.shortBreak); @@ -204,7 +204,7 @@ const CounterProvider: React.FC = ({ children }) => { }, [ setTimerDuration, timer.timerType, - config.stayFocused, + config.stayFocus, config.shortBreak, config.longBreak, ]); @@ -302,9 +302,9 @@ const CounterProvider: React.FC = ({ children }) => { "Break time finished.", { body: `Stay focused as much as possible for ${ - config.stayFocused + config.stayFocus } ${ - isEqualToOne(config.stayFocused) ? "minute" : "minutes" + isEqualToOne(config.stayFocus) ? "minute" : "minutes" }.`, }, settings.enableVoiceAssistance && breakFinishedWav @@ -325,9 +325,9 @@ const CounterProvider: React.FC = ({ children }) => { "Break time finished.", { body: `Stay focused as much as possible for ${ - config.stayFocused + config.stayFocus } ${ - isEqualToOne(config.stayFocused) ? "minute" : "minutes" + isEqualToOne(config.stayFocus) ? "minute" : "minutes" }.`, }, settings.enableVoiceAssistance && breakFinishedWav @@ -348,9 +348,9 @@ const CounterProvider: React.FC = ({ children }) => { "Break time finished.", { body: `Stay focused as much as possible for ${ - config.stayFocused + config.stayFocus } ${ - isEqualToOne(config.stayFocused) ? "minute" : "minutes" + isEqualToOne(config.stayFocus) ? "minute" : "minutes" }.`, }, settings.enableVoiceAssistance && breakFinishedWav @@ -372,7 +372,7 @@ const CounterProvider: React.FC = ({ children }) => { timer.timerType, dispatch, notification, - config.stayFocused, + config.stayFocus, config.shortBreak, config.longBreak, config.sessionRounds, diff --git a/app/renderer/src/routes/Config/SliderSection.tsx b/app/renderer/src/routes/Config/SliderSection.tsx index f41839f2..e2dd4ce5 100644 --- a/app/renderer/src/routes/Config/SliderSection.tsx +++ b/app/renderer/src/routes/Config/SliderSection.tsx @@ -1,7 +1,7 @@ import React, { useCallback } from "react"; import { useAppSelector, useAppDispatch } from "hooks/storeHooks"; import { - setStayFocused, + setStayFocus, setSessionRounds, setShorBreak, setLongBreak, @@ -12,9 +12,9 @@ import ConfigSlider, { ConfigSliderProps } from "./ConfigSlider"; const SliderSection: React.FC = () => { const dispatch = useAppDispatch(); - const { stayFocused, shortBreak, longBreak, sessionRounds } = + const { stayFocus, shortBreak, longBreak, sessionRounds } = useAppSelector(({ config }) => ({ - stayFocused: config.stayFocused, + stayFocus: config.stayFocus, shortBreak: config.shortBreak, longBreak: config.longBreak, sessionRounds: config.sessionRounds, @@ -26,9 +26,9 @@ const SliderSection: React.FC = () => { valueType: "mins", minValue: 1, maxValue: 120, - value: stayFocused, + value: stayFocus, handleConfigChange: useCallback( - (value) => dispatch(setStayFocused(parseInt(value))), + (value) => dispatch(setStayFocus(parseInt(value))), [dispatch] ), }, diff --git a/app/renderer/src/store/config/defaultConfig.ts b/app/renderer/src/store/config/defaultConfig.ts index 0d0b25db..162251e5 100644 --- a/app/renderer/src/store/config/defaultConfig.ts +++ b/app/renderer/src/store/config/defaultConfig.ts @@ -1,7 +1,7 @@ import { ConfigTypes } from "./types"; export const defaultConfig: Readonly = Object.freeze({ - stayFocused: 25, + stayFocus: 25, shortBreak: 5, longBreak: 15, sessionRounds: 4, diff --git a/app/renderer/src/store/config/index.ts b/app/renderer/src/store/config/index.ts index 9352fabc..a8bfa87a 100644 --- a/app/renderer/src/store/config/index.ts +++ b/app/renderer/src/store/config/index.ts @@ -13,8 +13,8 @@ const configSlice = createSlice({ name: "config", initialState, reducers: { - setStayFocused(state, action: ConfigPayload<"stayFocused">) { - state.stayFocused = action.payload; + setStayFocus(state, action: ConfigPayload<"stayFocus">) { + state.stayFocus = action.payload; }, setShorBreak(state, action: ConfigPayload<"shortBreak">) { @@ -70,7 +70,7 @@ export const { setSecondSpecialBreak, setSessionRounds, setShorBreak, - setStayFocused, + setStayFocus, setThirdSpecialBreak, setFirstSpecialBreak, } = configSlice.actions; diff --git a/app/renderer/src/store/config/types.ts b/app/renderer/src/store/config/types.ts index a47a00ff..ee613583 100644 --- a/app/renderer/src/store/config/types.ts +++ b/app/renderer/src/store/config/types.ts @@ -7,7 +7,7 @@ export type SpecialBreakTypes = { }; export type ConfigTypes = { - stayFocused: number; + stayFocus: number; shortBreak: number; longBreak: number; sessionRounds: number;