Skip to content

Commit

Permalink
fix: πŸ› fix test and add pre-push hook
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Jun 30, 2019
1 parent c32d02b commit 1353b6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -30,7 +30,8 @@
},
"husky": {
"hooks": {
"pre-commit": "yarn lint:types && lint-staged"
"pre-commit": "yarn lint:types && lint-staged",
"pre-push": "yarn lint && yarn clean && yarn build && yarn test"
}
},
"author": "@streamich",
Expand Down
3 changes: 2 additions & 1 deletion src/useSpeech.ts
Expand Up @@ -19,7 +19,8 @@ export interface SpeechOptions {
volume?: number;
}

const voices = window.speechSynthesis.getVoices();
const voices =
typeof window === 'object' && typeof window.speechSynthesis === 'object' ? window.speechSynthesis.getVoices() : [];

const useSpeech = (text: string, opts: SpeechOptions = {}): SpeechState => {
const [state, setState] = useSetState<SpeechState>({
Expand Down

0 comments on commit 1353b6c

Please sign in to comment.