Skip to content

Commit

Permalink
Revert variable names
Browse files Browse the repository at this point in the history
Variable names have been reverted to pre-49941a16.
  • Loading branch information
ZelnickB committed Mar 19, 2024
1 parent 49941a1 commit 574a2a4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
26 changes: 13 additions & 13 deletions app/renderer/src/contexts/CounterContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -77,7 +77,7 @@ const CounterProvider: React.FC = ({ children }) => {
}
}, [
config.longBreak,
config.stayFocused,
config.stayFocus,
config.shortBreak,
timer.timerType,
duration,
Expand Down Expand Up @@ -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);
Expand All @@ -204,7 +204,7 @@ const CounterProvider: React.FC = ({ children }) => {
}, [
setTimerDuration,
timer.timerType,
config.stayFocused,
config.stayFocus,
config.shortBreak,
config.longBreak,
]);
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -372,7 +372,7 @@ const CounterProvider: React.FC = ({ children }) => {
timer.timerType,
dispatch,
notification,
config.stayFocused,
config.stayFocus,
config.shortBreak,
config.longBreak,
config.sessionRounds,
Expand Down
10 changes: 5 additions & 5 deletions app/renderer/src/routes/Config/SliderSection.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useCallback } from "react";
import { useAppSelector, useAppDispatch } from "hooks/storeHooks";
import {
setStayFocused,
setStayFocus,
setSessionRounds,
setShorBreak,
setLongBreak,
Expand All @@ -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,
Expand All @@ -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]
),
},
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/src/store/config/defaultConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConfigTypes } from "./types";

export const defaultConfig: Readonly<ConfigTypes> = Object.freeze({
stayFocused: 25,
stayFocus: 25,
shortBreak: 5,
longBreak: 15,
sessionRounds: 4,
Expand Down
6 changes: 3 additions & 3 deletions app/renderer/src/store/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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">) {
Expand Down Expand Up @@ -70,7 +70,7 @@ export const {
setSecondSpecialBreak,
setSessionRounds,
setShorBreak,
setStayFocused,
setStayFocus,
setThirdSpecialBreak,
setFirstSpecialBreak,
} = configSlice.actions;
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/src/store/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type SpecialBreakTypes = {
};

export type ConfigTypes = {
stayFocused: number;
stayFocus: number;
shortBreak: number;
longBreak: number;
sessionRounds: number;
Expand Down

0 comments on commit 574a2a4

Please sign in to comment.