Commit 1dffc084 authored by Matthew Taylor's avatar Matthew Taylor

change the way invites are assigned

assign invites directly to the state rather than by defaults in order to ensure empty objects can be part of an update
parent 7e85d2c7
......@@ -27,7 +27,7 @@ module.exports.getInitialState = function () {
messages: {
admin: [],
social: [],
invite: [{}]
invite: {}
}
};
};
......@@ -51,9 +51,8 @@ module.exports.messagesReducer = function (state, action) {
messages: {socialOffset: action.offset}
}, state);
case 'SET_SCRATCHER_INVITE':
return defaultsDeep({
messages: {invite: [action.invite]}
}, state);
state.messages.invite = action.invite;
return state;
case 'ADMIN_STATUS':
return defaultsDeep({status: {admin: action.status}}, state);
case 'MESSAGE_STATUS':
......
......@@ -162,7 +162,7 @@ var mapStateToProps = function (state) {
numNewMessages: state.messageCount.messageCount,
messages: state.messages.messages.social,
adminMessages: state.messages.messages.admin,
invite: state.messages.messages.invite[0],
invite: state.messages.messages.invite,
messageOffset: state.messages.messages.socialOffset,
requestStatus: state.messages.status
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment