diff --git a/app/renderer/src/config.ts b/app/renderer/src/config.ts index 14962304..063686a7 100644 --- a/app/renderer/src/config.ts +++ b/app/renderer/src/config.ts @@ -65,7 +65,7 @@ export const compactRoutes: NavItemTypes[] = [ export const rangeConfig: ConfigSliderProps[] = [ { - label: "Stay focus", + label: "Stay focused", valueType: "mins", minValue: 0, maxValue: 60, diff --git a/app/renderer/src/contexts/CounterContext.tsx b/app/renderer/src/contexts/CounterContext.tsx index 9e9f9c96..0f76c46a 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.stayFocus * 60); + const [count, setCount] = useState(config.stayFocused * 60); - const [duration, setDuration] = useState(config.stayFocus * 60); + const [duration, setDuration] = useState(config.stayFocused * 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.stayFocus); + setTimerDuration(config.stayFocused); break; case TimerStatus.SHORT_BREAK: setTimerDuration(config.shortBreak); @@ -77,7 +77,7 @@ const CounterProvider: React.FC = ({ children }) => { } }, [ config.longBreak, - config.stayFocus, + config.stayFocused, config.shortBreak, timer.timerType, duration, @@ -192,7 +192,7 @@ const CounterProvider: React.FC = ({ children }) => { useEffect(() => { switch (timer.timerType) { case TimerStatus.STAY_FOCUS: - setTimerDuration(config.stayFocus); + setTimerDuration(config.stayFocused); break; case TimerStatus.SHORT_BREAK: setTimerDuration(config.shortBreak); @@ -204,7 +204,7 @@ const CounterProvider: React.FC = ({ children }) => { }, [ setTimerDuration, timer.timerType, - config.stayFocus, + config.stayFocused, 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.stayFocus + config.stayFocused } ${ - isEqualToOne(config.stayFocus) ? "minute" : "minutes" + isEqualToOne(config.stayFocused) ? "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.stayFocus + config.stayFocused } ${ - isEqualToOne(config.stayFocus) ? "minute" : "minutes" + isEqualToOne(config.stayFocused) ? "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.stayFocus + config.stayFocused } ${ - isEqualToOne(config.stayFocus) ? "minute" : "minutes" + isEqualToOne(config.stayFocused) ? "minute" : "minutes" }.`, }, settings.enableVoiceAssistance && breakFinishedWav @@ -372,7 +372,7 @@ const CounterProvider: React.FC = ({ children }) => { timer.timerType, dispatch, notification, - config.stayFocus, + config.stayFocused, config.shortBreak, config.longBreak, config.sessionRounds, diff --git a/app/renderer/src/routes/Config/ConfigSlider.tsx b/app/renderer/src/routes/Config/ConfigSlider.tsx index 1dab9840..d64ab35f 100644 --- a/app/renderer/src/routes/Config/ConfigSlider.tsx +++ b/app/renderer/src/routes/Config/ConfigSlider.tsx @@ -57,7 +57,7 @@ const ConfigSlider: React.FC = ({ }; ConfigSlider.defaultProps = { - label: "Stay focus", + label: "Stay focused", valueType: "mins", }; diff --git a/app/renderer/src/routes/Config/SliderSection.tsx b/app/renderer/src/routes/Config/SliderSection.tsx index c93fd12b..f41839f2 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 { - setStayFocus, + setStayFocused, setSessionRounds, setShorBreak, setLongBreak, @@ -12,9 +12,9 @@ import ConfigSlider, { ConfigSliderProps } from "./ConfigSlider"; const SliderSection: React.FC = () => { const dispatch = useAppDispatch(); - const { stayFocus, shortBreak, longBreak, sessionRounds } = + const { stayFocused, shortBreak, longBreak, sessionRounds } = useAppSelector(({ config }) => ({ - stayFocus: config.stayFocus, + stayFocused: config.stayFocused, shortBreak: config.shortBreak, longBreak: config.longBreak, sessionRounds: config.sessionRounds, @@ -22,13 +22,13 @@ const SliderSection: React.FC = () => { const sliderRangeList: ConfigSliderProps[] = [ { - label: "Stay focus", + label: "Stay focused", valueType: "mins", minValue: 1, maxValue: 120, - value: stayFocus, + value: stayFocused, handleConfigChange: useCallback( - (value) => dispatch(setStayFocus(parseInt(value))), + (value) => dispatch(setStayFocused(parseInt(value))), [dispatch] ), }, diff --git a/app/renderer/src/store/config/defaultConfig.ts b/app/renderer/src/store/config/defaultConfig.ts index 162251e5..0d0b25db 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({ - stayFocus: 25, + stayFocused: 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 a8bfa87a..9352fabc 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: { - setStayFocus(state, action: ConfigPayload<"stayFocus">) { - state.stayFocus = action.payload; + setStayFocused(state, action: ConfigPayload<"stayFocused">) { + state.stayFocused = action.payload; }, setShorBreak(state, action: ConfigPayload<"shortBreak">) { @@ -70,7 +70,7 @@ export const { setSecondSpecialBreak, setSessionRounds, setShorBreak, - setStayFocus, + setStayFocused, setThirdSpecialBreak, setFirstSpecialBreak, } = configSlice.actions; diff --git a/app/renderer/src/store/config/types.ts b/app/renderer/src/store/config/types.ts index ee613583..a47a00ff 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 = { - stayFocus: number; + stayFocused: number; shortBreak: number; longBreak: number; sessionRounds: number;