Commit b82d312d authored by Matthew Taylor's avatar Matthew Taylor

make invite an array instead of an object

When trying to clear the invite, because invite is currently an object, it’s getting the state’s existing invite re-applied via `defaultsDeep`. Making it an array should solve this issue
parent 7a3290a2
......@@ -27,7 +27,7 @@ module.exports.getInitialState = function () {
messages: {
admin: [],
social: [],
invite: {}
invite: []
}
};
};
......@@ -52,7 +52,7 @@ module.exports.messagesReducer = function (state, action) {
}, state);
case 'SET_SCRATCHER_INVITE':
return defaultsDeep({
messages: {invite: action.invite}
messages: {invite: [action.invite]}
}, state);
case 'ADMIN_STATUS':
return defaultsDeep({status: {admin: action.status}}, state);
......
......@@ -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,
invite: state.messages.messages.invite[0],
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