Skip to content

fix: reset ProfileEditForm when store-derived defaultValues change - #1002

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
dominiccreates:main
Jul 26, 2026
Merged

fix: reset ProfileEditForm when store-derived defaultValues change#1002
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
dominiccreates:main

Conversation

@dominiccreates

Copy link
Copy Markdown
Contributor

Closes #972
This PR resolves an issue in ProfileEditForm where the form fields do not update to reflect changes in the underlying store state (such as name, theme, and notifications).

While the defaultValues object was correctly memoized and updated on store changes, useForm only consumes these defaults on the initial component mount.

Solution:

Extracted the reset method from useForm.
Added a useEffect hook that triggers reset(defaultValues) whenever the memoized defaultValues change, ensuring the form stays in sync with the global store state.
Changes
Updated imports to include useEffect in src/components/profile/ProfileEditForm.tsx.
Added the reset effect keyed on defaultValues.

@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@dominiccreates Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project

@RUKAYAT-CODER
RUKAYAT-CODER merged commit 9a5dcd8 into rinafcode:main Jul 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reset ProfileEditForm when store-derived default values change

2 participants