@@ -136,14 +136,7 @@ class _ChoiceSetManagerBase extends _SubManagerBase {
136136 return false ;
137137 }
138138
139- // If we're running on a connection < RPC 7.1, we need to de-duplicate cells because presenting them will fail if we have the same cell primary text.
140- if ( choices !== null && this . _lifecycleManager . getSdlMsgVersion ( ) !== null
141- && ( this . _lifecycleManager . getSdlMsgVersion ( ) . getMajorVersion ( ) < 7
142- || ( this . _lifecycleManager . getSdlMsgVersion ( ) . getMajorVersion ( ) === 7 && this . _lifecycleManager . getSdlMsgVersion ( ) . getMinorVersion ( ) === 0 ) ) ) {
143- // version if 7.0.0 or lower
144- this . _addUniqueNamesToCells ( choices ) ;
145- }
146- const choicesToUpload = choices . map ( choice => choice ) ; // shallow copy
139+ const choicesToUpload = this . _getChoicesToBeUploadedWithArray ( choices ) ;
147140
148141 this . _removeChoicesFromChoices ( this . _preloadedChoices , choicesToUpload ) ;
149142 this . _removeChoicesFromChoices ( this . _pendingPreloadChoices , choicesToUpload ) ;
@@ -553,6 +546,22 @@ class _ChoiceSetManagerBase extends _SubManagerBase {
553546 . setKeypressMode ( KeypressMode . RESEND_CURRENT_ENTRY ) ;
554547 }
555548
549+ /**
550+ * Modifies the choices names depending on SDL version
551+ * @param {ChoiceCell[] } choices - The first list of choices
552+ * @returns {ChoiceCell[] } - A deep copy of the name modified choices
553+ */
554+ _getChoicesToBeUploadedWithArray ( choices ) {
555+ // If we're running on a connection < RPC 7.1, we need to de-duplicate cells because presenting them will fail if we have the same cell primary text.
556+ if ( choices !== null && this . _lifecycleManager . getSdlMsgVersion ( ) !== null
557+ && ( this . _lifecycleManager . getSdlMsgVersion ( ) . getMajorVersion ( ) < 7
558+ || ( this . _lifecycleManager . getSdlMsgVersion ( ) . getMajorVersion ( ) === 7 && this . _lifecycleManager . getSdlMsgVersion ( ) . getMinorVersion ( ) === 0 ) ) ) {
559+ // version if 7.0.0 or lower
560+ this . _addUniqueNamesToCells ( choices ) ;
561+ }
562+ return choices . map ( choice => choice . clone ( ) ) ; // deep copy
563+ }
564+
556565 /**
557566 * Listen for DISPLAYS capability updates
558567 * @private
0 commit comments