aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/preferences.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-07-10 15:24:10 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-07-10 15:24:10 -0700
commit0512964d71a25c172735f2149ef60c3a8b20f683 (patch)
treef47b42326a7e6a0eaa2715ca8066cb3ca7e7bb90 /modern/src/common/preferences.js
parent627cf95d59f625dcb0544bfd4c067d99dee4bb93 (diff)
downloadtrackermap-web-0512964d71a25c172735f2149ef60c3a8b20f683.tar.gz
trackermap-web-0512964d71a25c172735f2149ef60c3a8b20f683.tar.bz2
trackermap-web-0512964d71a25c172735f2149ef60c3a8b20f683.zip
Use modified airbnb eslint
Diffstat (limited to 'modern/src/common/preferences.js')
-rw-r--r--modern/src/common/preferences.js30
1 files changed, 12 insertions, 18 deletions
diff --git a/modern/src/common/preferences.js b/modern/src/common/preferences.js
index 24fe389a..aba3c82c 100644
--- a/modern/src/common/preferences.js
+++ b/modern/src/common/preferences.js
@@ -1,21 +1,15 @@
import { useSelector } from 'react-redux';
-export const usePreference = (key, defaultValue) => {
- return useSelector(state => {
- if (state.session.server.forceSettings) {
- return state.session.server[key] || state.session.user[key] || defaultValue;
- } else {
- return state.session.user[key] || state.session.server[key] || defaultValue;
- }
- });
-};
+export const usePreference = (key, defaultValue) => useSelector((state) => {
+ if (state.session.server.forceSettings) {
+ return state.session.server[key] || state.session.user[key] || defaultValue;
+ }
+ return state.session.user[key] || state.session.server[key] || defaultValue;
+});
-export const useAttributePreference = (key, defaultValue) => {
- return useSelector(state => {
- if (state.session.server.forceSettings) {
- return state.session.server.attributes[key] || state.session.user.attributes[key] || defaultValue;
- } else {
- return state.session.user.attributes[key] || state.session.server.attributes[key] || defaultValue;
- }
- });
-};
+export const useAttributePreference = (key, defaultValue) => useSelector((state) => {
+ if (state.session.server.forceSettings) {
+ return state.session.server.attributes[key] || state.session.user.attributes[key] || defaultValue;
+ }
+ return state.session.user.attributes[key] || state.session.server.attributes[key] || defaultValue;
+});