mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
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
This commit is contained in:
parent
7e85d2c731
commit
1dffc08445
2 changed files with 4 additions and 5 deletions
|
@ -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
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue