-
-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle user update events #3403
Conversation
8d12511
to
d5932e1
Compare
Add `UserAvatarSource` type and use it in `InitialDataRealmUser` in place of the incorrect 'G' string literal. * G - Gravatar * U - Upload
ec06280
to
8f917cc
Compare
The user update action has three different payloads depending on what part of the user's profile has been changed: * full name edited * avatar change * custom profile field edited
This function takes a 'user' and an update information object given by us by the back-end and produces a new, updated user object.
8f917cc
to
6881870
Compare
Fixes zulip#3397 Part of zulip#3408 Handles the three types of user data updates possible: * full name * avatar * custom profile field Extra care is taken not to mutate the state if not necessary. This is done for two reasons: * currently editing values throught he web app causes two events, one of which is not necessary (maybe should be fixed) * this is likely the largest state, doing an extra `isEqual` can save copying all this data
6881870
to
f049142
Compare
Thanks @borisyankov ! ba41931 flow: Add
|
email: string, | ||
|}; | ||
|
||
/** Contains only one of the possible payloads */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @borisyankov, I'm editing #3421 based on this PR. It seems that Zulip server API allows an update request to have multiple payloads, email and full name for example, so is there any reason to keep UserUpdatePayload
to have only one payload?
Thanks, all, for looking into this! Closing as replaced by #5386, as mentioned there. |
Fixes #3397 Part of #3408
Handles the three types of user data updates possible:
Extra care is taken not to mutate the state if not necessary.
This is done for two reasons:
one of which is not necessary (maybe should be fixed)
isEqual
cansave copying all this data