aboutsummaryrefslogtreecommitdiff
path: root/modern/src
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src')
-rw-r--r--modern/src/common/components/SelectField.jsx3
-rw-r--r--modern/src/settings/ServerPage.jsx1
-rw-r--r--modern/src/settings/UserPage.jsx1
-rw-r--r--modern/src/settings/components/BaseCommandView.jsx1
4 files changed, 1 insertions, 5 deletions
diff --git a/modern/src/common/components/SelectField.jsx b/modern/src/common/components/SelectField.jsx
index bc0571d5..920c2640 100644
--- a/modern/src/common/components/SelectField.jsx
+++ b/modern/src/common/components/SelectField.jsx
@@ -14,7 +14,6 @@ const SelectField = ({
onChange,
endpoint,
data,
- keyField = 'id',
keyGetter = (item) => item.id,
titleGetter = (item) => item.name,
}) => {
@@ -22,7 +21,7 @@ const SelectField = ({
const getOptionLabel = (option) => {
if (typeof option !== 'object') {
- option = items.find(obj => keyField ? obj[keyField] === option : obj === option);
+ option = items.find(obj => keyGetter(obj) === option);
}
return option ? titleGetter(option) : '';
}
diff --git a/modern/src/settings/ServerPage.jsx b/modern/src/settings/ServerPage.jsx
index 4dc87887..09a02f91 100644
--- a/modern/src/settings/ServerPage.jsx
+++ b/modern/src/settings/ServerPage.jsx
@@ -197,7 +197,6 @@ const ServerPage = () => {
emptyValue={null}
onChange={(e) => setItem({ ...item, attributes: { ...item.attributes, timezone: e.target.value } })}
endpoint="/api/server/timezones"
- keyField={false}
keyGetter={(it) => it}
titleGetter={(it) => it}
label={t('sharedTimezone')}
diff --git a/modern/src/settings/UserPage.jsx b/modern/src/settings/UserPage.jsx
index 7411ee64..dee7f2ac 100644
--- a/modern/src/settings/UserPage.jsx
+++ b/modern/src/settings/UserPage.jsx
@@ -271,7 +271,6 @@ const UserPage = () => {
emptyValue={null}
onChange={(e) => setItem({ ...item, attributes: { ...item.attributes, timezone: e.target.value } })}
endpoint="/api/server/timezones"
- keyField={false}
keyGetter={(it) => it}
titleGetter={(it) => it}
label={t('sharedTimezone')}
diff --git a/modern/src/settings/components/BaseCommandView.jsx b/modern/src/settings/components/BaseCommandView.jsx
index 070ecfed..f4d5d4b2 100644
--- a/modern/src/settings/components/BaseCommandView.jsx
+++ b/modern/src/settings/components/BaseCommandView.jsx
@@ -31,7 +31,6 @@ const BaseCommandView = ({ deviceId, item, setItem }) => {
value={item.type || null}
onChange={(e) => setItem({ ...item, type: e.target.value, attributes: {} })}
endpoint={deviceId ? `/api/commands/types?${new URLSearchParams({ deviceId }).toString()}` : '/api/commands/types'}
- keyField='type'
keyGetter={(it) => it.type}
titleGetter={(it) => t(prefixString('command', it.type))}
label={t('sharedType')}