pass a copy when opening dialog

otherwise, any changes the dialog makes will reflect in the calling
view's object
This commit is contained in:
Girish Ramakrishnan
2025-10-08 12:38:19 +02:00
parent ea28c10a39
commit f1fb5f2530
10 changed files with 11 additions and 3 deletions
+2 -1
View File
@@ -85,6 +85,7 @@ async function onSubmit() {
defineExpose({
async open(m = null) {
m = m ? JSON.parse(JSON.stringify(m)) : null; // make a copy
busy.value = false;
formError.value = '';
mailbox.value = m;
@@ -92,7 +93,7 @@ defineExpose({
name.value = m ? m.name : '';
domain.value = m ? m.domain : props.domains[0].domain;
ownerId.value = m ? m.ownerId : '';
aliases.value = m ? JSON.parse(JSON.stringify(m.aliases)) : [];
aliases.value = m ? m.aliases : [];
active.value = m ? m.active : true;
enablePop3.value = m ? m.enablePop3 : false;
storageQuotaEnabled.value = m && m.storageQuota ? true : false;