diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-06-13 09:14:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-13 09:14:16 +0200 |
commit | 4ecedffb5b97604c7cfa88e8bd427177d7d3fc82 (patch) | |
tree | 470ed5cd7312ee357737c0b2814b4fde42390ff6 /apps | |
parent | 311a7edd0f391ad4c9ad4cf49d543c4c3808adaa (diff) | |
parent | 2948c5e1f1665307ebb6844a2eaa4c3fa195b478 (diff) | |
download | nextcloud-server-4ecedffb5b97604c7cfa88e8bd427177d7d3fc82.tar.gz nextcloud-server-4ecedffb5b97604c7cfa88e8bd427177d7d3fc82.zip |
Merge pull request #31345 from nextcloud/fix/31164/delete-additional-email
Fix deletion of additional emails
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/src/components/PersonalInfo/EmailSection/Email.vue | 1 | ||||
-rw-r--r-- | apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue index ef03ae0677d..deb5da3a798 100644 --- a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue +++ b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue @@ -51,7 +51,6 @@ <Actions class="email__actions" :aria-label="t('settings', 'Email options')" - :disabled="deleteDisabled" :force-menu="true"> <ActionButton :aria-label="deleteEmailLabel" :close-after-click="true" diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue b/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue index 07ec35861a9..1c548bf8355 100644 --- a/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue +++ b/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue @@ -46,8 +46,9 @@ <template v-if="additionalEmails.length"> <em class="additional-emails-label">{{ t('settings', 'Additional emails') }}</em> + <!-- TODO use unique key for additional email when uniqueness can be guaranteed, see https://github.com/nextcloud/server/issues/26866 --> <Email v-for="(additionalEmail, index) in additionalEmails" - :key="index" + :key="additionalEmail.key" :index="index" :scope.sync="additionalEmail.scope" :email.sync="additionalEmail.value" @@ -85,7 +86,7 @@ export default { data() { return { accountProperty: ACCOUNT_PROPERTY_READABLE_ENUM.EMAIL, - additionalEmails, + additionalEmails: additionalEmails.map(properties => ({ ...properties, key: this.generateUniqueKey() })), displayNameChangeSupported, primaryEmail, savePrimaryEmailScope, @@ -119,7 +120,7 @@ export default { methods: { onAddAdditionalEmail() { if (this.isValidSection) { - this.additionalEmails.push({ value: '', scope: DEFAULT_ADDITIONAL_EMAIL_SCOPE }) + this.additionalEmails.push({ value: '', scope: DEFAULT_ADDITIONAL_EMAIL_SCOPE, key: this.generateUniqueKey() }) } }, @@ -184,6 +185,10 @@ export default { this.logger.error(errorMessage, error) } }, + + generateUniqueKey() { + return Math.random().toString(36).substring(2) + }, }, } </script> |