Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
client/compiled
dist
npm-debug
package-lock.json
Empty file removed client/containers/containers.js
Empty file.
5 changes: 4 additions & 1 deletion client/reducers/authReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { CHANGE_AUTH_FIELD } from '../actions/action';
const authReducer = (state = {}, action) => {
switch (action.type) {
case CHANGE_AUTH_FIELD:
return Object.assign({}, state, {[action.field]: action.value});
return {
...state,
[action.field]: action.value
};
default:
return state;
}
Expand Down
15 changes: 9 additions & 6 deletions client/reducers/chatReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ const initialState = {
const chatReducer = (state = {}, action) => {
switch (action.type) {
case FETCHING_MESSAGES:
return Object.assign({}, state, {
return {
...state,
fetching: true
});
};
case MESSAGES_FETCHED:
return Object.assign({}, state, {
return {
...state,
fetched: false,
fetching: true,
messages: action.payload
});
};
case MESSAGES_ERROR:
return Object.assign({}, state, {
return {
...state,
fetching: false,
fetched: true,
error: action.payload
});
};
default:
return state;
}
Expand Down
21 changes: 17 additions & 4 deletions client/reducers/firepadReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,26 @@ const initialState = {
const firepadReducer = (state = initialState, action) => {
switch (action.type) {
case FETCHING_FIREPAD:
return Object.assign({}, state, { fetching: true });
return {
...state,
fetching: true
};
case FIREPAD_FETCHED:
return Object.assign({}, state, { fetched: true, fetching: false});
return {
...state,
fetched: true,
fetching: false
};
case FIREPAD_MODE:
return Object.assign({}, state, { mode: action.mode });
return {
...state,
mode: action.mode
};
case TOGGLE_DIV:
return Object.assign({}, state, { hidden: !action.hidden });
return {
...state,
hidden: !action.hidden
};
default:
return state;
}
Expand Down
5 changes: 4 additions & 1 deletion client/reducers/inputReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { CHANGE_MESSAGE_TEXT } from '../actions/action';
const inputReducer = (state = {}, action) => {
switch (action.type) {
case CHANGE_MESSAGE_TEXT:
return Object.assign({}, state, {[action.field]: action.text});
return {
...state,
[action.field]: action.text
};
default:
return state;
}
Expand Down
15 changes: 9 additions & 6 deletions client/reducers/pchatReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ const initialState = {
const pchatReducer = (state = {}, action) => {
switch (action.type) {
case FETCHING_PCHAT:
return Object.assign({}, state, {
return {
...state,
fetching: true
});
};
case PCHAT_FETCHED:
return Object.assign({}, state, {
return {
...state,
fetched: false,
fetching: true,
privMessages: action.payload
});
};
case PCHAT_ERROR:
return Object.assign({}, state, {
return {
...state,
fetching: false,
fetched: true,
error: action.payload
});
};
default:
return state;
}
Expand Down
17 changes: 10 additions & 7 deletions client/reducers/roomChatReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,27 @@ const initialState = {
const roomChatReducer = (state = initialState, action) => {
switch (action.type) {
case FETCHING_ROOM_MESSAGES:
return Object.assign({}, state, {
return {
...state,
fetching: true
});
};
case ROOM_MESSAGES_FETCHED:
return Object.assign({}, state, {
return {
...state,
fetched: false,
fetching: true,
roomMsgs: action.payload
});
};
case ROOM_MESSAGES_ERROR:
return Object.assign({}, state, {
return {
...state,
fetching: false,
fetched: true,
error: action.payload
});
};
default:
return state;
}
};

export default roomChatReducer;
export default roomChatReducer;
23 changes: 14 additions & 9 deletions client/reducers/roomReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,32 @@ const initialState = {
const roomReducer = (state = initialState, action) => {
switch(action.type) {
case FETCHING_ROOMS:
return Object.assign({}, state, {fetching: true} );
return {
...state,
fetching: true
}
case FETCHED_ROOMS:
return Object.assign({}, state, {
return {
...state,
fetching: false,
fetched: true,
rooms: action.payload
});
}
case FETCHED_ROOMS_ERROR:
return Object.assign({}, state, {
return {
...state,
fetching: false,
fetched: true,
error: action.payload
});
};
case CHOOSE_ROOM:
return Object.assign({}, state, {
return {
...state,
chosenRoom: action.chosenRoom
});

};
default:
return state;
}
};

export default roomReducer;
export default roomReducer;
15 changes: 9 additions & 6 deletions client/reducers/whiteboardReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ const initialState = {
const whiteboardReducer = (state = initialState, action) => {
switch (action.type) {
case FETCHING_WHITEBOARD:
return Object.assign({}, state, {
return {
...state,
fetching: true
});
}
case WHITEBOARD_FETCHED:
return Object.assign({}, state, {
return {
...state,
fetching: false,
fetched: true,
whiteboardId: action.payload
});
};
case WHITEBOARD_ERROR:
return Object.assign({}, state, {
return {
...state,
fetching: false,
fetched: true,
error: action.payload
});
};
default:
return state;
}
Expand Down
1 change: 0 additions & 1 deletion client/store/configureStore.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import reducer from '../reducers/combine.js';
import { createStore, applyMiddleware } from 'redux';
import logger from 'redux-logger';
import thunk from 'redux-thunk';

export default function configureStore (preloadedState) {
Expand Down