aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-02 16:54:42 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-02 16:54:42 -0700
commit44fd230a4c0043a6e89a793bcf333072a01441a6 (patch)
treec4681bf322e2d4e5cf1c7258ada2b3c985468471 /modern/src/settings
parent8f3b27e86ac9b9a94bdd5319501ecb7e056ec595 (diff)
downloadtrackermap-web-44fd230a4c0043a6e89a793bcf333072a01441a6.tar.gz
trackermap-web-44fd230a4c0043a6e89a793bcf333072a01441a6.tar.bz2
trackermap-web-44fd230a4c0043a6e89a793bcf333072a01441a6.zip
Option to hide login language (fix #654)
Diffstat (limited to 'modern/src/settings')
-rw-r--r--modern/src/settings/ServerPage.js4
-rw-r--r--modern/src/settings/components/SettingsMenu.js2
2 files changed, 4 insertions, 2 deletions
diff --git a/modern/src/settings/ServerPage.js b/modern/src/settings/ServerPage.js
index 26ef5bbf..90b854db 100644
--- a/modern/src/settings/ServerPage.js
+++ b/modern/src/settings/ServerPage.js
@@ -29,6 +29,7 @@ import SettingsMenu from './components/SettingsMenu';
import useCommonDeviceAttributes from '../common/attributes/useCommonDeviceAttributes';
import useCommonUserAttributes from '../common/attributes/useCommonUserAttributes';
import { useCatch } from '../reactHelper';
+import useServerAttributes from '../common/attributes/useServerAttributes';
const useStyles = makeStyles((theme) => ({
container: {
@@ -59,6 +60,7 @@ const ServerPage = () => {
const commonUserAttributes = useCommonUserAttributes(t);
const commonDeviceAttributes = useCommonDeviceAttributes(t);
+ const serverAttributes = useServerAttributes(t);
const original = useSelector((state) => state.session.server);
const [item, setItem] = useState({ ...original });
@@ -238,7 +240,7 @@ const ServerPage = () => {
<EditAttributesView
attributes={item.attributes}
setAttributes={(attributes) => setItem({ ...item, attributes })}
- definitions={{ ...commonUserAttributes, ...commonDeviceAttributes }}
+ definitions={{ ...commonUserAttributes, ...commonDeviceAttributes, ...serverAttributes }}
/>
</AccordionDetails>
</Accordion>
diff --git a/modern/src/settings/components/SettingsMenu.js b/modern/src/settings/components/SettingsMenu.js
index a37d5d1a..181cd74c 100644
--- a/modern/src/settings/components/SettingsMenu.js
+++ b/modern/src/settings/components/SettingsMenu.js
@@ -34,7 +34,7 @@ const SettingsMenu = () => {
const readonly = useReadonly();
const admin = useAdministrator();
const manager = useManager();
- const userId = useSelector((state) => state.session.user?.id);
+ const userId = useSelector((state) => state.session.user.id);
const features = useFeatures();