Skip to content

Commit

Permalink
fix: set optOut watch default value (bloom-housing#4512)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinBuyck committed Dec 19, 2024
1 parent 7cdb90e commit de5e413
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sites/partners/src/components/settings/PreferenceDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ const PreferenceDrawer = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [questionData])

const optOutQuestion = watch("canYouOptOutQuestion")
const optOutQuestion = watch(
"canYouOptOutQuestion",
// set watch default value to mirror canYouOptOutQuestion default on load
questionData === null || questionData?.optOutText !== null ? YesNoEnum.yes : undefined
)

const isAdditionalDetailsEnabled = profile?.jurisdictions?.some(
(jurisdiction) => jurisdiction.enableGeocodingPreferences
Expand Down

0 comments on commit de5e413

Please sign in to comment.