@@ -428,6 +428,10 @@ class="card border-0"
428428 this .sendEvent (' taskReady' , this .task ? .id );
429429 });
430430 },
431+ validateBase64 (field ) {
432+ const regex = / ^ data:image\/ \w + ;base64,/ ;
433+ return regex .test (field);
434+ },
431435 },
432436 mounted () {
433437 this .prepareData ();
@@ -441,6 +445,7 @@ class="card border-0"
441445 screenFields .forEach ((field ) => {
442446
443447 const existingValue = _ .get (this .formData , field, null );
448+
444449 let quickFillValue;
445450
446451 if (existingValue) {
@@ -450,8 +455,14 @@ class="card border-0"
450455 // use the value from the quick fill(event.detail)
451456 quickFillValue = _ .get (event .detail , field, null );
452457 }
458+
459+ if (this .validateBase64 (quickFillValue)) {
460+ _ .set (newData, field, existingValue);
461+ return ;
462+ }
453463 // Set the value. This handles nested values using dot notation in 'field' string
454464 _ .set (newData, field, quickFillValue);
465+
455466 });
456467
457468 this .formData = newData;
@@ -461,6 +472,14 @@ class="card border-0"
461472 // want to use all data saved in the inbox rule db record, regardless
462473 // if the field exists or not.
463474 window .addEventListener (' fillDataOverwriteExistingFields' , event => {
475+ for (let key in event .detail ) {
476+ if (event .detail .hasOwnProperty (key)) {
477+ let value = event .detail [key];
478+ if (this .validateBase64 (value)) {
479+ delete event .detail [key];
480+ }
481+ }
482+ }
464483 this .formData = _ .merge (_ .cloneDeep (this .formData ), event .detail );
465484 });
466485
0 commit comments