Skip to content

Commit 1353b6c

Browse files
committed
fix: πŸ› fix test and add pre-push hook
1 parent c32d02b commit 1353b6c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

β€Žpackage.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
},
3131
"husky": {
3232
"hooks": {
33-
"pre-commit": "yarn lint:types && lint-staged"
33+
"pre-commit": "yarn lint:types && lint-staged",
34+
"pre-push": "yarn lint && yarn clean && yarn build && yarn test"
3435
}
3536
},
3637
"author": "@streamich",

β€Žsrc/useSpeech.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export interface SpeechOptions {
1919
volume?: number;
2020
}
2121

22-
const voices = window.speechSynthesis.getVoices();
22+
const voices =
23+
typeof window === 'object' && typeof window.speechSynthesis === 'object' ? window.speechSynthesis.getVoices() : [];
2324

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

0 commit comments

Comments
Β (0)