diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-09-15 15:16:22 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-09-15 16:38:49 +0300 |
commit | b22628f9e6dc06b02ffd02bc7322df1998f67ad6 (patch) | |
tree | 254eef090e0a6ea920d0fb91c70ffaa09a3a8967 /apps/settings/src | |
parent | d93e2548f0b1b2a464b8ce8eaff520627f9ac2dc (diff) |
offer to unset notification email instead of disabling
- also the only way to reset when system mail cannot be modified
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/settings/src')
-rw-r--r-- | apps/settings/src/components/PersonalInfo/EmailSection/Email.vue | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue index f56dcce917c..d3d700ca16b 100644 --- a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue +++ b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue @@ -65,7 +65,7 @@ @click.stop.prevent="deleteEmail"> {{ deleteEmailLabel }} </ActionButton> - <ActionButton + <ActionButton v-if="!primary || !isNotificationEmail" :aria-label="setNotificationMailLabel" :close-after-click="true" :disabled="setNotificationMailDisabled" @@ -171,13 +171,12 @@ export default { }, setNotificationMailDisabled() { - return this.isNotificationEmail - || (!this.primary && this.localVerificationState !== VERIFICATION_ENUM.VERIFIED) + return !this.primary && this.localVerificationState !== VERIFICATION_ENUM.VERIFIED }, setNotificationMailLabel() { if (this.isNotificationEmail) { - return t('settings', 'Your primary email') + return t('settings', 'Unset as primary email') } else if (!this.primary && this.localVerificationState !== VERIFICATION_ENUM.VERIFIED) { return t('settings', 'This address is not confirmed') } @@ -280,9 +279,10 @@ export default { async setNotificationMail() { try { - const responseData = await saveNotificationEmail(this.primary ? '' : this.initialEmail) + const newNotificationMailValue = (this.primary || this.isNotificationEmail) ? '' : this.initialEmail + const responseData = await saveNotificationEmail(newNotificationMailValue) this.handleResponse({ - notificationEmail: this.primary ? '' : this.initialEmail, + notificationEmail: newNotificationMailValue, status: responseData.ocs?.meta?.status, }) } catch (e) { |