Skip to content

Commit aa02b93

Browse files
committed
[MNY-250] Fix Save button not enabled after changing Royalty BPS in contract settings page (#8252)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces a new option `shouldDirty` in the `setValue` function for form handling in two components, enhancing form state management by marking fields as dirty when their values change. ### Detailed summary - In `royalties.tsx`, added `shouldDirty: true` to `form.setValue` for `seller_fee_basis_points`. - In `platform-fees.tsx`, added `shouldDirty: true` to `form.setValue` for `platform_fee_basis_points`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Platform Fees and Royalties settings now correctly recognize field edits as changes, ensuring the Save action becomes available when values are updated. * Unsaved-changes indicators and prompts reflect updates immediately, reducing the chance of losing edits. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent c9a0c23 commit aa02b93

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/platform-fees.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export function SettingsPlatformFees({
137137
onChange={(value) =>
138138
form.setValue("platform_fee_basis_points", value, {
139139
shouldValidate: true,
140+
shouldDirty: true,
140141
})
141142
}
142143
value={form.watch("platform_fee_basis_points")}

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/royalties.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export function SettingsRoyalties({
151151
onChange={(value) =>
152152
form.setValue("seller_fee_basis_points", value, {
153153
shouldValidate: true,
154+
shouldDirty: true,
154155
})
155156
}
156157
value={form.watch("seller_fee_basis_points")}

0 commit comments

Comments
 (0)