Skip to content

Commit

Permalink
fix(speech): set default speech name
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonGolms committed Mar 6, 2021
1 parent 398431b commit e3ae391
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/data/user/user.slice.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import { ChapterId } from '../../utils/chapters';
import { SPEECH_LANGUAGE_DEFAULT } from '../speech/speech.constants';

type CurrentView = 'card' | 'list';

Expand Down Expand Up @@ -41,7 +42,7 @@ const initialState: UserState = {
favorites: [],
currentFavoritesView: 'card',
currentSearchView: 'card',
currentSpeechName: 'en-US-ArialNeural',
currentSpeechName: SPEECH_LANGUAGE_DEFAULT.name,
currentTheme: 'system',
hasSeenTutorial: false,
};
Expand Down
9 changes: 3 additions & 6 deletions src/pages/Settings/SettingSpeechItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ import { SPEECH_LANGUAGES_SUPPORTED } from '../../data/speech/speech.constants';
export const SettingsSpeechItems: React.FC = () => {
const { t } = useTranslation();
const dispatch = useDispatch();
const currentSpeech = useSelector(selectCurrentSpeech);
const { name } = useSelector(selectCurrentSpeech);

return (
<IonRadioGroup
value={currentSpeech.name}
value={name}
onIonChange={(event) => {
console.log(
'🚀 ~ file: SettingSpeechItems.tsx ~ line 24 ~ event',
event,
);
dispatch(
setCurrentSpeechName({ currentSpeechName: event.detail.value }),
);
Expand Down

0 comments on commit e3ae391

Please sign in to comment.