diff --git a/src/actions/auth.js b/src/actions/auth.js index 1ea3bf6b05c13b0c5e2f7eca6addd97a0e4d6933..be78309dff0b3021079228824f4767178ece3e1a 100644 --- a/src/actions/auth.js +++ b/src/actions/auth.js @@ -14,10 +14,14 @@ export const getUserData = () => ( const { id, join_date: joinDate, nick, motivation, signed, groups, } = user.data; + const motivationJSON = JSON.parse(motivation); + const motivationAbout = motivationJSON.first; + const motivationProfession = motivationJSON.second; + const motivationExercise = motivationJSON.third; dispatch({ type: GET_USERDATA, payload: { - id, joinDate, nick, motivation, signed, groups, + id, joinDate, nick, motivationAbout, motivationProfession, motivationExercise, signed, groups, }, }); } @@ -51,7 +55,7 @@ export const submitRegistration = ({ }) => ( async (dispatch) => { const response = await axios.patch(`/api/v1/profiles/${id}/`, { - nick, groups, signed, motivationAbout, motivationProfession, motivationExercise, + nick, groups, signed, motivation: JSON.stringify({ first: motivationAbout, second: motivationProfession, third: motivationExercise }), }); if (response.data.id === id) { alert('Sikeres mentĂŠs!'); @@ -65,7 +69,7 @@ export const logout = () => ( async (dispatch) => { const response = await axios.get('/api/v1/logout/'); if (response) { - dispatch({ action: LOGOUT }); + dispatch({ type: LOGOUT }); } } ); diff --git a/src/components/pages/Home.js b/src/components/pages/Home.js index 909e5b0deffc332cfe2fbba3f7e451e7c95b5e0c..8a7850161c6c01bf29a4ba6f37891d9ccd37212c 100644 --- a/src/components/pages/Home.js +++ b/src/components/pages/Home.js @@ -24,6 +24,7 @@ const settings = { slidesToShow: 1, slidesToScroll: 1, centerMode: true, + lazyLoad: true, }; const range = (count) => { diff --git a/src/index.js b/src/index.js index 1d37e06b60fd0d7943ebdc2a3e1430d586231210..359a223975289c15b2fb4a06a84efcdd89c92979 100644 --- a/src/index.js +++ b/src/index.js @@ -8,7 +8,7 @@ import 'semantic-ui-css/semantic.min.css'; import configureStore from './configureStore'; import App from './components/App'; -// import registerServiceWorker from './registerServiceWorker'; +import registerServiceWorker from './registerServiceWorker'; const store = configureStore(); @@ -21,4 +21,4 @@ render( document.getElementById('root'), ); -// registerServiceWorker(); +registerServiceWorker();