Skip to content

Commit

Permalink
fix: set optOut watch default value (bloom-housing#4512) (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinBuyck authored Dec 19, 2024
1 parent 4b4727c commit e5221a8
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 e5221a8

Please sign in to comment.