Skip to content

Commit

Permalink
Standarize names
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-drozd-it committed Apr 25, 2024
1 parent 5b80622 commit 2f09d57
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/components/countdowntimer/CountdownTimerChip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import moment from 'moment';
const CountdownTimerChip = (): JSX.Element => {
const isEnabled = useAppSelector((state) => state.countdownTimer.isEnabled);
const timeLeft = useAppSelector((state) => state.countdownTimer.timeLeft);
const timeInit = useAppSelector((state) => state.countdownTimer.timeInit);
const timeSet = useAppSelector((state) => state.countdownTimer.timeSet);

const totalTime = moment.duration(timeInit);
const totalTime = moment.duration(timeSet);
const leftTime = moment.duration(timeLeft);

const totalSeconds = totalTime.asSeconds();
Expand Down
2 changes: 1 addition & 1 deletion src/store/actions/countdownTimerActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ AppThunk<Promise<void>> => async (

dispatch(countdownTimerActions.setCountdownTimer({ timeLeft, isStarted: false }));

dispatch(countdownTimerActions.setCountdownTimerTimeInit({ timeInit: timeLeft, isStarted: false }));
dispatch(countdownTimerActions.setCountdownTimerTimeSet({ timeSet: timeLeft, isStarted: false }));

} catch (error) {
logger.error('setCountdownTimer() [error:"%o"]', error);
Expand Down
2 changes: 1 addition & 1 deletion src/store/actions/roomActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const joinRoom = (): AppThunk<Promise<void>> => async (
dispatch(roomSessionsActions.addMessages({ sessionId, messages: chatHistory }));
dispatch(roomSessionsActions.addFiles({ sessionId, files: fileHistory }));
dispatch(countdownTimerActions.setCountdownTimer(countdownTimer));
dispatch(countdownTimerActions.setCountdownTimerTimeInit(countdownTimer));
dispatch(countdownTimerActions.setCountdownTimerTimeSet(countdownTimer));

dispatch(countdownTimer.isStarted ?
countdownTimerActions.startCountdownTimer() :
Expand Down
6 changes: 3 additions & 3 deletions src/store/middlewares/countdownTimerMiddleware.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ const createCountdownTimerMiddleware = ({

case 'moderator:setCountdownTimer': {

const { timeLeft, timeInit, isStarted } = notification.data;
const { timeLeft, timeSet, isStarted } = notification.data;

dispatch(countdownTimerActions.setCountdownTimer(
{ timeLeft, isStarted }));

dispatch(countdownTimerActions.setCountdownTimerTimeInit(
{ timeInit, isStarted }));
dispatch(countdownTimerActions.setCountdownTimerTimeSet(
{ timeSet, isStarted }));

break;
}
Expand Down
8 changes: 4 additions & 4 deletions src/store/slices/countdownTimerSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit';
interface CountdownTimerState {
isEnabled: boolean;
isStarted: boolean;
timeInit: string;
timeSet: string;
timeLeft: string;
}

const initialState : CountdownTimerState = {
isEnabled: true,
isStarted: false,
timeInit: '00:00:00',
timeSet: '00:00:00',
timeLeft: '00:00:00',
};

Expand All @@ -33,8 +33,8 @@ const countdownTimerSlice = createSlice({
setCountdownTimer: ((state, action: PayloadAction<any>) => {
state.timeLeft = action.payload.timeLeft;
}),
setCountdownTimerTimeInit: ((state, action: PayloadAction<any>) => {
state.timeInit = action.payload.timeInit;
setCountdownTimerTimeSet: ((state, action: PayloadAction<any>) => {
state.timeSet = action.payload.timeSet;
}),
}
});
Expand Down

0 comments on commit 2f09d57

Please sign in to comment.