We want to update CurrentUserInfo in Redux on successful updateUserAvatarActionTypes.success.
Details
Details
- Observe that avatar is set:
- Send { type: 'remove' } to update_user_avatar and observe that the avatar is unset in Redux:
- Send
const emojiUpdateRequest = { type: 'emoji', emoji: 'π', color: '4b87aa', };
to update_user_avatar and observe that CurrentUserInfo is updated as expected:
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Branch
- arcpatch-D7156 (branched from master)
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
lib/reducers/user-reducer.js | ||
---|---|---|
97β101 β | (On Diff #24035) | This condition doesn't "smell right," but it's the only approach I could think of that made flow happy. Should I be doing this differently? All the other action handlers in reduceCurrentUserInfo update CurrentUserInfo "atomically." As in they either keep or replace CurrentUserInfo "in one go." None of them modify a single field of the object at a time. The state check is to determine whether the existing ?CurrentUserInfo is truthy, and the !state.anonymous check is to ensure that the existing ?CurrentUserInfo is a ?LoggedInUserInfo (LoggedOutUserInfo doesn't have an avatar field). |
lib/reducers/user-reducer.js | ||
---|---|---|
97β101 β | (On Diff #24035) | It seems fine |