Skip to content

Commit

Permalink
feat: add countdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Gurnick013 authored and lbratkovskaya committed Apr 14, 2021
1 parent 92f35ac commit 9c9857f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/GameSprint/StartGameSprint/StartGameSprint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from '../../../store/actions/sprintAction';
import { fetchDictionary } from '../../../store/actions/dictionaryActions';
import { fetchWords } from '../../../store/actions/wordBookActions';
import { changeCountDown } from '../../../store/actions/gamesActions';
import { MAX_LENGTH_GAME_ARR, SELECT_ROUNDS } from '../constants';
import { GAMES, WORDBOOK_GROUPS } from '../../../constants';
import { IAppState, IWord } from '../../../store/types';
Expand All @@ -34,6 +35,7 @@ const StartGameSprint: React.FC = () => {
const onReduceArrayWords = (wordsArray: IWord[]) => dispatch(reduceArrayWords(wordsArray));
const switchLanguage = (isEng: boolean) => dispatch(switchLang(isEng));
const getDictionaryWords = () => dispatch(fetchDictionary(userData));
const countDownStart = (isCount: boolean) => dispatch(changeCountDown(isCount));

const location = useLocation();
const isCameFromWordbook = location.state?.fromWordbook;
Expand Down Expand Up @@ -75,6 +77,7 @@ const StartGameSprint: React.FC = () => {
setRound(randomPage);
onReduceArrayWords(wordBook?.words);
}
countDownStart(true);
onClickStartGame(true);
};

Expand Down

0 comments on commit 9c9857f

Please sign in to comment.