aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/util/preferences.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/common/util/preferences.js')
-rw-r--r--modern/src/common/util/preferences.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/modern/src/common/util/preferences.js b/modern/src/common/util/preferences.js
index 229b6f17..0604d848 100644
--- a/modern/src/common/util/preferences.js
+++ b/modern/src/common/util/preferences.js
@@ -39,3 +39,10 @@ export const useAttributePreference = (key, defaultValue) => useSelector((state)
}
return defaultValue;
});
+
+export const useServerAttributePreference = (key, defaultValue) => useSelector((state) => {
+ if (containsProperty(state.session.server.attributes, key)) {
+ return state.session.server.attributes[key];
+ }
+ return defaultValue;
+}); \ No newline at end of file