diff --git a/packages/twenty-front/src/modules/ui/field/input/components/CurrencyInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/CurrencyInput.tsx index 8a72584b5a5c..fb751159d68d 100644 --- a/packages/twenty-front/src/modules/ui/field/input/components/CurrencyInput.tsx +++ b/packages/twenty-front/src/modules/ui/field/input/components/CurrencyInput.tsx @@ -7,6 +7,7 @@ import { SETTINGS_FIELD_CURRENCY_CODES } from '@/settings/data-model/constants/S import { IconComponent } from '@/ui/display/icon/types/IconComponent'; import { CurrencyPickerDropdownButton } from '@/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton'; import { TEXT_INPUT_STYLE } from '@/ui/theme/constants/TextInputStyle'; +import { isNonNullable } from '~/utils/isNonNullable'; export const StyledInput = styled.input` margin: 0; @@ -117,7 +118,7 @@ export const CurrencyInput = ({ useEffect(() => { const currency = currencies.find(({ value }) => value === currencyCode); - if (currency) { + if (isNonNullable(currency)) { setInternalCurrency(currency); } }, [currencies, currencyCode]); diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton.tsx index 305ca9851da7..09605d9cc48d 100644 --- a/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton.tsx +++ b/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton.tsx @@ -6,6 +6,7 @@ import { CurrencyCode } from '@/object-record/record-field/types/CurrencyCode'; import { IconChevronDown } from '@/ui/display/icon'; import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown'; import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown'; +import { isNonNullable } from '~/utils/isNonNullable'; import { CurrencyPickerHotkeyScope } from '../types/CurrencyPickerHotkeyScope'; @@ -76,7 +77,7 @@ export const CurrencyPickerDropdownButton = ({ useEffect(() => { const currency = currencies.find(({ value }) => value === valueCode); - if (currency) { + if (isNonNullable(currency)) { setSelectedCurrency(currency); } }, [valueCode, currencies]);