diff --git a/src/components/settings_modal/helpers/list_setting.js b/src/components/settings_modal/helpers/list_setting.js index 7c504fe64..def6064d0 100644 --- a/src/components/settings_modal/helpers/list_setting.js +++ b/src/components/settings_modal/helpers/list_setting.js @@ -57,7 +57,6 @@ export default { }, suggestionsSet () { const suggestions = this.backendDescriptionSuggestions - console.log(suggestions) if (suggestions) { return new Set(suggestions) } else { @@ -68,7 +67,7 @@ export default { if (this.ignoreSuggestions) return [...this.valueSet.values()] if (!this.suggestionsSet) return [] return [...this.valueSet.values()].filter((x) => { - return !this.suggestionsSet?.has(x) + return !this.builtinEntriesValueSet.has(x) }) }, builtinEntries () { @@ -81,8 +80,11 @@ export default { const builtins = [...this.suggestionsSet.values()] return builtins.map((option) => ({ label: option, - value: this.valueSet.has(option) + value: option })) + }, + builtinEntriesValueSet () { + return new Set(this.builtinEntries.map(x => x.value)) } }, methods: { @@ -90,32 +92,38 @@ export default { optionPresent (option) { return this.valueSet.has(option) }, - getValue ({ event, index, eventType }) { + getValue ({ event, value, index, eventType }) { switch (eventType) { case 'toggle': { this.newValue = '' - return [...this.visibleState, event] + const newSet = new Set(this.valueSet.values()) + if (event) { + newSet.add(value) + } else { + newSet.delete(value) + } + return [...newSet.values()] } case 'add': { - if (!this.newValue) return this.visibleState - const res = [...this.visibleState, this.newValue] + if (!this.newValue) return this.valueSet.values() + const res = [...this.valueSet.values(), this.newValue] this.newValue = '' return res } case 'remove': { - const pre = this.visibleState.slice(0, index) - const post = this.visibleState.slice(index + 1) + const pre = [...this.valueSet.values()].slice(0, index) + const post = [...this.valueSet.values()].slice(index + 1) return [...pre, ...post] } case 'edit': { - const pre = this.visibleState.slice(0, index) - const post = this.visibleState.slice(index + 1) + const pre = [...this.valueSet.values()].slice(0, index) + const post = [...this.valueSet.values()].slice(index + 1) const string = event.target.value - if (!string) return this.visibleState + if (!string) return [...this.valueSet.values()] return [...pre, string, ...post] } diff --git a/src/components/settings_modal/helpers/list_setting.vue b/src/components/settings_modal/helpers/list_setting.vue index a6dcae6f2..b34b18431 100644 --- a/src/components/settings_modal/helpers/list_setting.vue +++ b/src/components/settings_modal/helpers/list_setting.vue @@ -27,7 +27,7 @@ {{ item.label }} diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js index a3fcf252a..031e66dc0 100644 --- a/src/components/settings_modal/helpers/setting.js +++ b/src/components/settings_modal/helpers/setting.js @@ -255,7 +255,6 @@ export default { } }, canHardReset () { - console.log('MP', this.$store.state.adminSettings.modifiedPaths.has) return this.realSource === 'admin' && this.$store.state.adminSettings.modifiedPaths?.has(this.canonPath.join(' -> ')) }, matchesExpertLevel () { diff --git a/src/modules/adminSettings.js b/src/modules/adminSettings.js index 3f443d594..1ea01eeb6 100644 --- a/src/modules/adminSettings.js +++ b/src/modules/adminSettings.js @@ -106,6 +106,15 @@ const adminSettingsStorage = { set(config, path, convert(c.value)) }) console.log('CONFIG', JSON.parse(JSON.stringify(config))) + // patching http adapter config to be easier to handle + const adapter = config[':pleroma'][':http'][':adapter'] + if (Array.isArray(adapter)) { + config[':pleroma'][':http'][':adapter'] = { + [':ssl_options']: { + [':versions']: [] + } + } + } commit('updateAdminSettings', { config, modifiedPaths }) commit('resetAdminDraft') },