Skip to content

Commit

Permalink
Don't let Unleash errors propagate
Browse files Browse the repository at this point in the history
  • Loading branch information
fyrk committed Sep 22, 2023
1 parent 10670af commit 5e87f6e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/helpers/unleash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ const UNLEASH_VARIANT_SELECT_MODES: {
} as const

export function useUnleashVariantSelectModes(): UnleashVariantSelectModes {
const variantName = useVariant("taylorsversion.variant-select-modes").name
return (
UNLEASH_VARIANT_SELECT_MODES[variantName] ||
UNLEASH_VARIANT_SELECT_MODES["single-samestolen-everywhere"]
)
try {
const variantName = useVariant("taylorsversion.variant-select-modes").name
return (
UNLEASH_VARIANT_SELECT_MODES[variantName] ||
UNLEASH_VARIANT_SELECT_MODES["single-samestolen-everywhere"]
)
} catch (e) {
return UNLEASH_VARIANT_SELECT_MODES["single-samestolen-everywhere"]
}
}

0 comments on commit 5e87f6e

Please sign in to comment.