diff --git a/frontend/src/containers/RoomCreatePage.js b/frontend/src/containers/RoomCreatePage.js index 351409f..c88f755 100644 --- a/frontend/src/containers/RoomCreatePage.js +++ b/frontend/src/containers/RoomCreatePage.js @@ -9,16 +9,16 @@ const RoomCreatePageContainer = (props) => { if ( !username ) { return } - else if( room ) { - return - } + // else if( room ) { + // return + // } else { return } } const mapStateToProps = state => ({ - room: state.room.room, + // room: state.room.room, username: state.user.username, token: state.user.token, }) diff --git a/frontend/src/store/room/reducer.js b/frontend/src/store/room/reducer.js index 01f3c9d..8bc6d95 100644 --- a/frontend/src/store/room/reducer.js +++ b/frontend/src/store/room/reducer.js @@ -49,7 +49,7 @@ const roomReducer = (state = initialState, action) => { case actions.ROOM_CREATE_SUCCESS: return { ...state, - room: action.room, + // room: action.room, roomList: [ ...state.roomList, action.room, diff --git a/frontend/src/store/room/sagas.js b/frontend/src/store/room/sagas.js index 2e92846..df9fe2c 100644 --- a/frontend/src/store/room/sagas.js +++ b/frontend/src/store/room/sagas.js @@ -1,3 +1,4 @@ +import { push } from 'connected-react-router' import { fork, takeEvery, put } from 'redux-saga/effects' import { toastr } from 'react-redux-toastr' import api from 'services/api' @@ -27,6 +28,7 @@ function* roomCreateRequest({ roomname, members, username, token }){ { icon: 'success', status: 'success', } ) yield put(actions.roomCreateSuccess(room)) + yield put(push(`/room/${room.url}/`)) } catch(e) { console.log(e) }