From 947b73f8702ff4b7c5f74620204e86a4f375315c Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 12 Mar 2023 16:55:39 +0200 Subject: [PATCH] minimize the rest of the sharedcomputedobject --- .../helpers/shared_computed_object.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/components/settings_modal/helpers/shared_computed_object.js b/src/components/settings_modal/helpers/shared_computed_object.js index e898c8ac..b8a016e6 100644 --- a/src/components/settings_modal/helpers/shared_computed_object.js +++ b/src/components/settings_modal/helpers/shared_computed_object.js @@ -1,18 +1,10 @@ -import { defaultState as configDefaultState } from 'src/modules/config.js' - const SharedComputedObject = () => ({ user () { return this.$store.state.users.currentUser }, - // Generating computed values for vuex properties - ...Object.keys(configDefaultState) - .map(key => [key, { - get () { return this.$store.getters.mergedConfig[key] }, - set (value) { - this.$store.dispatch('setOption', { name: key, value }) - } - }]) - .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}) + expertLevel () { + return this.$store.getters.mergedConfig.expertLevel > 0 + } }) export default SharedComputedObject