diff options
| author | Henry Jameson <me@hjkos.com> | 2023-03-14 21:50:43 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2023-03-14 21:50:43 +0200 |
| commit | 4d23d31fecf480abfccc4db3ac79c6640078dc3b (patch) | |
| tree | 545b0ffe95fe206db0cb39971a6aa8c3368b5617 /src/components/settings_modal/helpers/setting.js | |
| parent | 9632b77786a9d3735f04ecf4a814311fad926ad0 (diff) | |
initial admin settings prototype (WIP)
Diffstat (limited to 'src/components/settings_modal/helpers/setting.js')
| -rw-r--r-- | src/components/settings_modal/helpers/setting.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js index a766e6dc..9195d3e9 100644 --- a/src/components/settings_modal/helpers/setting.js +++ b/src/components/settings_modal/helpers/setting.js @@ -42,6 +42,8 @@ export default { switch (this.source) { case 'profile': return this.$store.state.profileConfig + case 'admin': + return this.$store.state.adminSettings.config default: return this.$store.getters.mergedConfig } @@ -50,6 +52,8 @@ export default { switch (this.source) { case 'profile': return (k, v) => this.$store.dispatch('setProfileOption', { name: k, value: v }) + case 'admin': + return (k, v) => console.log(this.path, k, v) default: return (k, v) => this.$store.dispatch('setOption', { name: k, value: v }) } @@ -66,7 +70,15 @@ export default { return this.source === 'profile' }, isChanged () { - return !this.source === 'default' && this.state !== this.defaultState + switch (this.source) { + case 'profile': + return false + case 'admin': + console.log(this.$store.state.adminSettings.modifiedPaths) + return this.$store.state.adminSettings.modifiedPaths.has(this.path) + default: + return this.state !== this.defaultState + } }, matchesExpertLevel () { return (this.expert || 0) <= this.$store.state.config.expertLevel > 0 |
