@@ -567,7 +567,9 @@ jQuery(function ($) {
567567 let baseURI = selector . prop ( 'baseURI' ) ;
568568 let mergeFieldID = selector . prop ( 'dataset' ) . merge_field_id ;
569569 let currentID = mergeFieldID . substring ( 0 , mergeFieldID . indexOf ( '_' ) ) ;
570- let dupeID = baseURI . substring ( baseURI . indexOf ( 'dupeid=' ) + 'dupeid=' . length ) ;
570+ let dupeID = baseURI . substring (
571+ baseURI . indexOf ( 'dupeid=' ) + 'dupeid=' . length ,
572+ ) ;
571573 let mergeContact = currentID === dupeID ;
572574
573575 // Determine values to be updated
@@ -576,14 +578,16 @@ jQuery(function ($) {
576578
577579 // Update values accordingly
578580 for ( const sourceItem of sourceValue ) {
579- const valIdx = mergedValue . findIndex ( ( x ) => x . meta_id === sourceItem . meta_id ) ;
581+ const valIdx = mergedValue . findIndex (
582+ ( x ) => x . meta_id === sourceItem . meta_id ,
583+ ) ;
580584 if ( is_selected ) {
581585 // Add, if not already present
582586 if ( valIdx < 0 || mergeContact ) {
583587 mergedValue . push ( sourceItem ) ;
584588 // Remove old meta_id if we're adding values from the merged contact
585589 if ( mergeContact ) {
586- sourceItem . meta_id = "" ;
590+ sourceItem . meta_id = '' ;
587591 }
588592 }
589593 } else {
@@ -595,15 +599,15 @@ jQuery(function ($) {
595599 sourceItem ,
596600 )
597601 ) {
598- if ( mergeContact ) {
602+ if ( mergeContact ) {
599603 mergedValue . splice ( valIdx , 1 ) ;
600604 }
601605 }
602606 }
603607 }
604608
605609 // set delete flag to remove values from primary record
606- if ( ! mergeContact ) {
610+ if ( ! mergeContact ) {
607611 for ( const item of mergedValue ) {
608612 if ( item . meta_id !== '' ) {
609613 if ( is_selected ) {
0 commit comments