aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-14 16:03:25 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-14 16:03:25 -0700
commit8091d156d3379784d8d2f023c0a26944274542fd (patch)
tree1d4452420eb3d900dea3a43cba31aa9a5d69e26d
parent571b7b02d02627da140e493def26c1412eff1b46 (diff)
downloadtrackermap-web-8091d156d3379784d8d2f023c0a26944274542fd.tar.gz
trackermap-web-8091d156d3379784d8d2f023c0a26944274542fd.tar.bz2
trackermap-web-8091d156d3379784d8d2f023c0a26944274542fd.zip
Fix new user
-rw-r--r--modern/src/settings/UserPage.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/modern/src/settings/UserPage.js b/modern/src/settings/UserPage.js
index 7200329a..1fb7103f 100644
--- a/modern/src/settings/UserPage.js
+++ b/modern/src/settings/UserPage.js
@@ -99,7 +99,7 @@ const UserPage = () => {
<FormControl variant="filled" margin="normal" fullWidth>
<InputLabel>{t('settingsSpeedUnit')}</InputLabel>
<Select
- value={item.attributes.speedUnit || 'kn'}
+ value={(item.attributes && item.attributes.speedUnit) || 'kn'}
onChange={(e) => setItem({ ...item, attributes: { ...item.attributes, speedUnit: e.target.value } })}
>
<MenuItem value="kn">{t('sharedKn')}</MenuItem>
@@ -110,7 +110,7 @@ const UserPage = () => {
<FormControl variant="filled" margin="normal" fullWidth>
<InputLabel>{t('settingsDistanceUnit')}</InputLabel>
<Select
- value={item.attributes.distanceUnit || 'km'}
+ value={(item.attributes && item.attributes.distanceUnit) || 'km'}
onChange={(e) => setItem({ ...item, attributes: { ...item.attributes, distanceUnit: e.target.value } })}
>
<MenuItem value="km">{t('sharedKm')}</MenuItem>
@@ -121,7 +121,7 @@ const UserPage = () => {
<FormControl variant="filled" margin="normal" fullWidth>
<InputLabel>{t('settingsVolumeUnit')}</InputLabel>
<Select
- value={item.attributes.volumeUnit || 'ltr'}
+ value={(item.attributes && item.attributes.volumeUnit) || 'ltr'}
onChange={(e) => setItem({ ...item, attributes: { ...item.attributes, volumeUnit: e.target.value } })}
>
<MenuItem value="ltr">{t('sharedLiter')}</MenuItem>
@@ -131,7 +131,7 @@ const UserPage = () => {
</FormControl>
<SelectField
margin="normal"
- value={item.attributes.timezone || ''}
+ value={(item.attributes && item.attributes.timezone) || ''}
emptyValue=""
onChange={(e) => setItem({ ...item, attributes: { ...item.attributes, timezone: e.target.value } })}
endpoint="/api/server/timezones"