Skip to content

Commit 8dcf36f

Browse files
committed
refactor: Simplify cookie consent status display logic
Optimize pattern matching in PrivacySection to use `.otherwise()` for handling undecided cookie consent state
1 parent 5ac6b37 commit 8dcf36f

File tree

1 file changed

+3
-2
lines changed
  • src/components/pages/profile/settings/PrivacySection

1 file changed

+3
-2
lines changed

src/components/pages/profile/settings/PrivacySection/index.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ export function PrivacySection() {
7777
<>Cookies declined on {formatDate(lastConsentDate)}</>
7878
))
7979
.with(['no', P.nullish], () => <>Cookies declined</>)
80-
.with(['undecided', P._], () => <>Cookie preferences not yet configured</>)
81-
.exhaustive()}
80+
.otherwise(() => (
81+
<>Cookie preferences not yet configured</>
82+
))}
8283
</Typography>
8384
</EntryContentContainer>
8485
{consent === 'yes' ? (

0 commit comments

Comments
 (0)