diff options
author | Anton Tananaev <anton@traccar.org> | 2024-03-25 17:41:45 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-03-25 17:41:45 -0700 |
commit | 49716d98023ef0c10baf80d294383a892132a2dd (patch) | |
tree | 6e871b788921013ae30be092f64c1ce4fab346e8 | |
parent | f2be5ab566dfa07d27d4e84052a673fe36ec3363 (diff) | |
download | trackermap-web-49716d98023ef0c10baf80d294383a892132a2dd.tar.gz trackermap-web-49716d98023ef0c10baf80d294383a892132a2dd.tar.bz2 trackermap-web-49716d98023ef0c10baf80d294383a892132a2dd.zip |
Fix new maintenance crash
-rw-r--r-- | modern/src/settings/MaintenancePage.jsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modern/src/settings/MaintenancePage.jsx b/modern/src/settings/MaintenancePage.jsx index 2161e7eb..491a0d3b 100644 --- a/modern/src/settings/MaintenancePage.jsx +++ b/modern/src/settings/MaintenancePage.jsx @@ -70,7 +70,7 @@ const MaintenancePage = () => { const rawToValue = (start, value) => { const attribute = positionAttributes[item.type]; - if (item.type.endsWith('Time')) { + if (item.type?.endsWith('Time')) { if (start) { return dayjs(value).locale('en').format('YYYY-MM-DD'); } @@ -91,7 +91,7 @@ const MaintenancePage = () => { const valueToRaw = (start, value) => { const attribute = positionAttributes[item.type]; - if (item.type.endsWith('Time')) { + if (item.type?.endsWith('Time')) { if (start) { return dayjs(value, 'YYYY-MM-DD').valueOf(); } @@ -147,7 +147,7 @@ const MaintenancePage = () => { </Select> </FormControl> <TextField - type={item.type.endsWith('Time') ? 'date' : 'number'} + type={item.type?.endsWith('Time') ? 'date' : 'number'} value={rawToValue(true, item.start) || ''} onChange={(e) => setItem({ ...item, start: valueToRaw(true, e.target.value) })} label={labels.start ? `${t('maintenanceStart')} (${labels.start})` : t('maintenanceStart')} |