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