Skip to content

Commit

Permalink
Fix lint on new code
Browse files Browse the repository at this point in the history
Co-authored-by: v1b3m <[email protected]>
Co-authored-by: Toledodev <[email protected]>
  • Loading branch information
3 people committed Mar 9, 2024
1 parent 9a0f1c8 commit 9d18e07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -117,7 +118,7 @@ export const CurrencyInput = ({

useEffect(() => {
const currency = currencies.find(({ value }) => value === currencyCode);
if (currency) {
if (isNonNullable(currency)) {
setInternalCurrency(currency);
}
}, [currencies, currencyCode]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -76,7 +77,7 @@ export const CurrencyPickerDropdownButton = ({

useEffect(() => {
const currency = currencies.find(({ value }) => value === valueCode);
if (currency) {
if (isNonNullable(currency)) {
setSelectedCurrency(currency);
}
}, [valueCode, currencies]);
Expand Down

0 comments on commit 9d18e07

Please sign in to comment.