浏览代码

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>
tags/v23.0.0beta1
Arthur Schiwon 2 年前
父节点
当前提交
b22628f9e6
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6
    6
      apps/settings/src/components/PersonalInfo/EmailSection/Email.vue

+ 6
- 6
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) {

正在加载...
取消
保存