Skip to content

fix: save button stays enabled after saving availability (#26708)#28860

Draft
ousamabenyounes wants to merge 1 commit intocalcom:mainfrom
ousamabenyounes:fix/issue-26708
Draft

fix: save button stays enabled after saving availability (#26708)#28860
ousamabenyounes wants to merge 1 commit intocalcom:mainfrom
ousamabenyounes:fix/issue-26708

Conversation

@ousamabenyounes
Copy link
Copy Markdown

What does this PR do?

The Save button on the availability schedule page remained enabled after saving changes due to a property name mismatch in the formHasChanges comparison.

Root cause

The comparison checked initialValuesRef.current.availability, but the form field is named schedule. Since availability was never populated from defaultValues, it was always undefined, making the comparison always true.

- JSON.stringify(initialValuesRef.current.availability)
+ JSON.stringify(initialValuesRef.current.schedule)

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Navigate to /availability, click any schedule
  2. Make a change, click Save
  3. Before: button stays enabled. After: button disables correctly.

Files changed

File Change
packages/platform/atoms/availability/AvailabilitySettings.tsx Fix .availability.schedule
packages/platform/atoms/availability/AvailabilitySettings.test.tsx 7 unit tests for formHasChanges logic

Generated by Claude Code
Vibe coded by ousamabenyounes

The formHasChanges comparison referenced `.availability` but the form field
is named `schedule`, so `initialValuesRef.current.availability` was always
`undefined`. This made the first comparison always true, keeping the save
button permanently enabled after any edit.

Generated by Claude Code
Vibe coded by ousamabenyounes

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the 🐛 bug Something isn't working label Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The save button on the availability schedule page remains enabled after successfully saving changes.

1 participant