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
@@ -66,6 +66,7 @@ async function onSubmit() {
defineExpose({
async open(r = null) {
r = r ? JSON.parse(JSON.stringify(r)) : null; // make a copy
busy.value = false;
formError.value = {};
registry.value = r;
+1 -1
View File
@@ -63,7 +63,7 @@ async function onSubmit() {
defineExpose({
open(d) {
d = d || { config: {}, tlsConfig: {}};
d = d ? JSON.parse(JSON.stringify(d)) : { config: {}, tlsConfig: {} }; // make a copy
provider.value = d.provider || '';
dnsConfig.value = d.config;
+1
View File
@@ -53,6 +53,7 @@ async function onSubmit() {
defineExpose({
async open(g = null) {
g = g ? JSON.parse(JSON.stringify(g)) : null; // make a copy
group.value = g;
name.value = g ? g.name : '';
formError.value = {};
@@ -42,6 +42,7 @@ async function onSubmit() {
defineExpose({
async open(u) {
u = JSON.parse(JSON.stringify(u)); // make a copy
user.value = u;
success.value = false;
password.value = '';
@@ -31,6 +31,7 @@ async function onSendInvite() {
defineExpose({
async open(u) {
u = JSON.parse(JSON.stringify(u)); // make a copy
user.value = u;
success.value = false;
email.value = u.email || '';
+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;
@@ -57,6 +57,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 = {};
mailinglist.value = m;
@@ -35,6 +35,7 @@ async function onSend() {
defineExpose({
async open(u) {
u = JSON.parse(JSON.stringify(u)); // make a copy
user.value = u;
formError.value = '';
email.value = u.fallbackEmail || u.email;
+1
View File
@@ -179,6 +179,7 @@ async function onSubmit() {
defineExpose({
async open(u = null) {
u = u ? JSON.parse(JSON.stringify(u)) : null; // make a copy
busy.value = false;
formError.value = {};
user.value = u;