From 3e5d9dfc35cc62c8907cf60abe24d64298037697 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 17 Sep 2022 00:23:11 +0530 Subject: [PATCH] fix(api): email me enabling error re #3651 Signed-off-by: Pranav C --- packages/nc-gui/components/smartsheet/Form.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Form.vue b/packages/nc-gui/components/smartsheet/Form.vue index 6cc2670532..d2c955ffaa 100644 --- a/packages/nc-gui/components/smartsheet/Form.vue +++ b/packages/nc-gui/components/smartsheet/Form.vue @@ -243,8 +243,10 @@ async function checkSMTPStatus() { emailMe.value = false // Please activate SMTP plugin in App store for enabling email notification message.info(t('msg.toast.formEmailSMTP')) + return false } } + return true } function setFormData() { @@ -263,7 +265,6 @@ function setFormData() { } catch (e) {} emailMe.value = data[state.user.value?.email as string] - checkSMTPStatus() localColumns.value = col .filter( @@ -306,12 +307,13 @@ function isRequired(_columnObj: Record, required = false) { return required || (columnObj && columnObj.rqd && !columnObj.cdf) } -function updateEmail() { +async function updateEmail() { try { + if (!(await checkSMTPStatus())) return + const data = formViewData.value?.email ? JSON.parse(formViewData.value?.email) : {} data[state.user.value?.email as string] = emailMe.value formViewData.value!.email = JSON.stringify(data) - checkSMTPStatus() } catch (e) {} }