File tree Expand file tree Collapse file tree
apps/settings/src/components/PersonalInfo/EmailSection Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5050 <Actions
5151 class =" actions-email"
5252 :aria-label =" t('settings', 'Email options')"
53- :disabled =" deleteDisabled"
5453 :force-menu =" true" >
5554 <ActionButton
5655 :aria-label =" deleteEmailLabel"
Original file line number Diff line number Diff line change 4141 <span v-else >
4242 {{ primaryEmail.value || t('settings', 'No email address set') }}
4343 </span >
44+ <!-- TODO use unique key for additional email when uniqueness can be guaranteed, see https://github.com/nextcloud/server/issues/26866 -->
4445 <Email v-for =" (additionalEmail, index) in additionalEmails"
45- :key =" index "
46+ :key =" additionalEmail.key "
4647 :index =" index"
4748 :scope.sync =" additionalEmail.scope"
4849 :email.sync =" additionalEmail.value"
@@ -77,7 +78,7 @@ export default {
7778
7879 data () {
7980 return {
80- additionalEmails,
81+ additionalEmails: additionalEmails . map ( properties => ({ ... properties, key : this . generateUniqueKey () })) ,
8182 displayNameChangeSupported,
8283 primaryEmail,
8384 isValidForm: true ,
@@ -110,7 +111,7 @@ export default {
110111 methods: {
111112 onAddAdditionalEmail () {
112113 if (this .$refs .form ? .checkValidity ()) {
113- this .additionalEmails .push ({ value: ' ' , scope: DEFAULT_ADDITIONAL_EMAIL_SCOPE })
114+ this .additionalEmails .push ({ value: ' ' , scope: DEFAULT_ADDITIONAL_EMAIL_SCOPE , key : this . generateUniqueKey () })
114115 this .$nextTick (() => this .updateFormValidity ())
115116 }
116117 },
@@ -172,6 +173,10 @@ export default {
172173 updateFormValidity () {
173174 this .isValidForm = this .$refs .form ? .checkValidity ()
174175 },
176+
177+ generateUniqueKey () {
178+ return Math .random ().toString (36 ).substring (2 )
179+ },
175180 },
176181}
177182< / script>
You can’t perform that action at this time.
0 commit comments