fix(profile): prevent saving profile when no changes are made (@AzureNightlock)#7684
Conversation
|
Testing note: I created an edit-profile-spec test, and it passed locally. I wasn't able to fully verify this change visually because there isn't a Story for this section, and I wasn't able to set up the backend properly. So the validation for this change was based on the spec test and the updated no-change save logic. Also for future fixes in account-related areas like this, is there a recommended way to test them visually/locally end-to-end? I've run into this issue a few times and would love to be able to test these fixes better. |
|
|
||
| snapshot.details = response.body.data ?? updates; | ||
| snapshot.inventory?.badges.forEach((badge) => { | ||
| snapshot.inventory?.badges?.forEach((badge) => { |
There was a problem hiding this comment.
Why is this necessary? I don't think badges can be undefined/null.
There was a problem hiding this comment.
Thanks for pointing that out! I added it defensively but the extra optional chaining on badges was unnecessary. Sorry for that oversight and I appreciate the careful review!
|
hi @AzureNightlock , thank you for your contribution. The best call would be to get the backend working on your machine. Can you join discord so we can trouble shoot your problem? Let us know what other changes you have planned that are account-related. We are currently migrating the frontend to use solid-js and I think we can get this fix "for free" with the new stack. |
|
Sure I would love to! I have already joined the Discord already and I do have a few other account-related bugs in mind that I was thinking of looking into as well. |
Description
This PR: Fixes edit-profile.ts so the profile is not submitted again when the user clicks Save without making any changes.
To support that behavior, this PR:
Additional small fixes:
Checks
Closes #7683