From 17ec538da5f0d605053fbdbf71d090baebadb9a5 Mon Sep 17 00:00:00 2001 From: Marie <51697796+ijreilly@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:57:24 +0200 Subject: [PATCH] Fix DateTimeSettingsTimeZoneSelect (#7688) Fixing [sentry](https://twenty-v7.sentry.io/issues/5990711011/?alert_rule_id=15135099&alert_type=issue¬ification_uuid=06fea945-1c24-4ee6-94f6-99f1d7f94010&project=4507072563183616&referrer=discord) _Cannot read properties of undefined (reading 'label')_ --- .../appearance/components/DateTimeSettingsTimeZoneSelect.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsTimeZoneSelect.tsx b/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsTimeZoneSelect.tsx index 348cfded0..237550a1a 100644 --- a/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsTimeZoneSelect.tsx +++ b/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsTimeZoneSelect.tsx @@ -2,6 +2,7 @@ import { detectTimeZone } from '@/localization/utils/detectTimeZone'; import { findAvailableTimeZoneOption } from '@/localization/utils/findAvailableTimeZoneOption'; import { AVAILABLE_TIMEZONE_OPTIONS } from '@/settings/accounts/constants/AvailableTimezoneOptions'; import { Select } from '@/ui/input/components/Select'; +import { isDefined } from '~/utils/isDefined'; type DateTimeSettingsTimeZoneSelectProps = { value?: string; @@ -25,7 +26,9 @@ export const DateTimeSettingsTimeZoneSelect = ({ value={value} options={[ { - label: `System settings - ${systemTimeZoneOption.label}`, + label: isDefined(systemTimeZoneOption) + ? `System settings - ${systemTimeZoneOption.label}` + : 'System settings', value: 'system', }, ...AVAILABLE_TIMEZONE_OPTIONS,