fix: SMTP shouldn't be configurable without IMAP enabled (#4428)

* fix: Configure SMTP only if IMAP is enabled
This commit is contained in:
Aswin Dev P.S
2022-04-11 12:35:03 +05:30
committed by GitHub
parent b1efcde495
commit f1ae09d21b
4 changed files with 23 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
<settings-section
:title="$t('INBOX_MGMT.IMAP.TITLE')"
:sub-title="$t('INBOX_MGMT.IMAP.SUBTITLE')"
:note="$t('INBOX_MGMT.IMAP.NOTE_TEXT')"
>
<form @submit.prevent="updateInbox">
<label for="toggle-imap-enable">
@@ -132,7 +133,7 @@ export default {
async updateInbox() {
try {
this.loading = true;
const payload = {
let payload = {
id: this.inbox.id,
formData: false,
channel: {
@@ -147,6 +148,11 @@ export default {
: undefined,
},
};
if (!this.isIMAPEnabled) {
payload.channel.smtp_enabled = false;
}
await this.$store.dispatch('inboxes/updateInboxIMAP', payload);
this.showAlert(this.$t('INBOX_MGMT.IMAP.EDIT.SUCCESS_MESSAGE'));
} catch (error) {

View File

@@ -422,7 +422,7 @@
</settings-section>
</div>
<imap-settings :inbox="inbox" />
<smtp-settings :inbox="inbox" />
<smtp-settings v-if="inbox.imap_enabled" :inbox="inbox" />
</div>
</div>
<div v-if="selectedTabKey === 'preChatForm'">