From a80374838f326cde7c9f2eab82efd17a0dee3dda Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Fri, 20 Dec 2019 03:42:00 +0300 Subject: [PATCH] Add mailer tab, fix rendering and processing emails mailer settings --- src/store/modules/settings.js | 10 ++++++---- src/views/settings/components/Setting.vue | 7 +++++-- src/views/settings/index.vue | 3 +++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index b29a776c..66b2272a 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -45,13 +45,15 @@ const settings = { state.settings = newSettings }, UPDATE_SETTINGS: (state, { group, key, input, value, type }) => { - const updatedSetting = state.updatedSettings[group] - ? { [key]: { ...state.updatedSettings[group][key], ...{ [input]: [type, value] }}} - : { [key]: { [input]: [type, value] }} + const updatedSetting = !state.updatedSettings[group] || (key === 'Pleroma.Emails.Mailer' && input === ':adapter') + ? { [key]: { [input]: [type, value] }} + : { [key]: { ...state.updatedSettings[group][key], ...{ [input]: [type, value] }}} state.updatedSettings[group] = { ...state.updatedSettings[group], ...updatedSetting } }, UPDATE_STATE: (state, { group, key, input, value }) => { - const updatedState = { [key]: { ...state.settings[group][key], ...{ [input]: value }}} + const updatedState = key === 'Pleroma.Emails.Mailer' && input === ':adapter' + ? { [key]: { [input]: value }} + : { [key]: { ...state.settings[group][key], ...{ [input]: value }}} state.settings[group] = { ...state.settings[group], ...updatedState } } }, diff --git a/src/views/settings/components/Setting.vue b/src/views/settings/components/Setting.vue index 9293ec3d..e9fca8d2 100644 --- a/src/views/settings/components/Setting.vue +++ b/src/views/settings/components/Setting.vue @@ -11,9 +11,8 @@ :data="data"/>
-
child.group && child.group.includes(adapter)) + }, loading() { return this.$store.state.settings.loading } diff --git a/src/views/settings/index.vue b/src/views/settings/index.vue index d77ec950..f905fd31 100644 --- a/src/views/settings/index.vue +++ b/src/views/settings/index.vue @@ -41,6 +41,9 @@ + + +