Skip to content

fix(profile): prevent saving profile when no changes are made (@AzureNightlock)#7800

Closed
AzureNightlock wants to merge 1 commit intomonkeytypegame:masterfrom
AzureNightlock:fix/profile-save-without-changes
Closed

fix(profile): prevent saving profile when no changes are made (@AzureNightlock)#7800
AzureNightlock wants to merge 1 commit intomonkeytypegame:masterfrom
AzureNightlock:fix/profile-save-without-changes

Conversation

@AzureNightlock
Copy link
Copy Markdown
Contributor

Description

This PR: Disables the save button when no changes are made or when inputs are invalid.

Changes:

  • Wired up save button to disable/enable based on change detection
  • Added ProfileState type and getProfileState() to capture the form state
  • Refactored buildUpdatesFromInputs() to buildUpdatesFromState() so now it takes a ProfileState instead of reading directly from inputs
  • Added updateSaveButtonState() to disable the save button when nothing has changed or when inputs are invalid
  • Added hasProfileChanged() to compare the current state against the original saved state

Additional fixes:

  • Added getOriginalValue parameter to addValidation() to hide the validation indicator when the user types back the original saved value
  • Fixed initializeCharacterCounters() to only initialize once across modal opens
  • Removed manual length checks in updateProfile() since Zod schemas already handle validation

Checks

  • Check if any open issues are related to this PR; if so, be sure to tag them below.
  • Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info)
  • Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title.

Closes #7683

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Apr 9, 2026
@fehmer
Copy link
Copy Markdown
Member

fehmer commented Apr 9, 2026

We are currently migrating to solidjs, maybe don't put too much efforts into the old codebase

@AzureNightlock
Copy link
Copy Markdown
Contributor Author

Ahh got it, thanks for the heads up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile saves even when no changes are made

3 participants