aboutsummaryrefslogtreecommitdiff
path: root/modern/src/attributes
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-06 14:46:42 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-06 14:46:42 -0700
commit4810bef487c36c263326ecd7f4626a6354ecfdf5 (patch)
treee1b314b18305738b6beaa641ba4cda46d91f08a9 /modern/src/attributes
parente3460181198fa98c5320ebe28650160603797f33 (diff)
downloadtrackermap-web-4810bef487c36c263326ecd7f4626a6354ecfdf5.tar.gz
trackermap-web-4810bef487c36c263326ecd7f4626a6354ecfdf5.tar.bz2
trackermap-web-4810bef487c36c263326ecd7f4626a6354ecfdf5.zip
Special attributes for units
Diffstat (limited to 'modern/src/attributes')
-rw-r--r--modern/src/attributes/EditAttributesView.js3
-rw-r--r--modern/src/attributes/useUserAttributes.js12
2 files changed, 2 insertions, 13 deletions
diff --git a/modern/src/attributes/EditAttributesView.js b/modern/src/attributes/EditAttributesView.js
index 4343fde4..af90a73a 100644
--- a/modern/src/attributes/EditAttributesView.js
+++ b/modern/src/attributes/EditAttributesView.js
@@ -105,7 +105,8 @@ const EditAttributesView = ({ attributes, setAttributes, definitions }) => {
const convertToList = (attributes) => {
const booleanList = [];
const otherList = [];
- Object.keys(attributes || []).forEach((key) => {
+ const excludeAttributes = ['speedUnit', 'distanceUnit', 'volumeUnit'];
+ Object.keys(attributes || []).filter((key) => !excludeAttributes.includes(key)).forEach((key) => {
const value = attributes[key];
const type = getAttributeType(value);
const subtype = getAttributeSubtype(key);
diff --git a/modern/src/attributes/useUserAttributes.js b/modern/src/attributes/useUserAttributes.js
index 0101d2f5..3c5ea019 100644
--- a/modern/src/attributes/useUserAttributes.js
+++ b/modern/src/attributes/useUserAttributes.js
@@ -45,18 +45,6 @@ export default (t) => useMemo(() => ({
name: t('attributeUiHidePositionAttributes'),
type: 'string',
},
- distanceUnit: {
- name: t('settingsDistanceUnit'),
- type: 'string',
- },
- speedUnit: {
- name: t('settingsSpeedUnit'),
- type: 'string',
- },
- volumeUnit: {
- name: t('settingsVolumeUnit'),
- type: 'string',
- },
timezone: {
name: t('sharedTimezone'),
type: 'string',