diff --git a/src/actions/api/dictionary.js b/src/actions/api/dictionary.js index 43bc9cc..d08de00 100644 --- a/src/actions/api/dictionary.js +++ b/src/actions/api/dictionary.js @@ -36,7 +36,7 @@ const setDictioanry = dictioanry => ({ type: SET_PARSED_DICTIONARY, payload: dictioanry, }); -const setLoadingState = status => ({ +export const setLoadingState = status => ({ type: SET_LOADING_STATE, payload: status, }); @@ -54,7 +54,6 @@ export const wordInfo = word => async dispatch => { } */ //function which return universal template for more simple interaction with api - dispatch(setLoadingState(false)); //TODO available dictionary instead api1 await dispatch(setAvailableApi(api1)); const wordDictionary = await createDictionary(api1); diff --git a/src/components/Form/field-list.jsx b/src/components/Form/field-list.jsx index 9531d19..c2d5c27 100644 --- a/src/components/Form/field-list.jsx +++ b/src/components/Form/field-list.jsx @@ -55,6 +55,8 @@ const FieldList = props => { setLoadingState(false); } }); + useEffect(() => { + }, [pronunciation]) const submit = () => { props.setFields(props.fields); @@ -80,7 +82,7 @@ const FieldList = props => { role={EXAMPLES} data={{ label: 'Usage example', - values: examples || ['can not find the example'], + values: props.response.examples || ['can not find the example'], }} /> { role: SOUND, }) } - data={{values: [sound], label: 'Sound'}} + data={{values: [props.response.sound], label: 'Sound'}} role={SOUND} /> { }) } role={PRONUNCIATION} - data={{values: [pronunciation], label: 'Pronunciation'}} + data={{values: [props.response.pronunciation], label: 'Pronunciation'}} />