File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,21 @@ const createStore = (state) => {
4141 }
4242 } ,
4343 mutations : {
44+ /**
45+ * Updates current license attributes when user selects radio option.
46+ * Edge case: If user selects ND, SA should be set to false
47+ * @param state
48+ * @param {string } stepName
49+ * @param {Boolean } isSelected
50+ */
4451 setSelected ( state , { stepName, isSelected } ) {
45- // When a Radio button is selected, currentLicenseAttribute 'selected' attribute is updated
46- if ( [ 'BY' , 'NC' , 'ND' , 'SA' ] . indexOf ( stepName ) > - 1 ) {
52+ if ( stepName === 'ND' && isSelected && state . currentLicenseAttributes . SA ) {
53+ state . currentLicenseAttributes = {
54+ ...state . currentLicenseAttributes ,
55+ SA : false ,
56+ ND : true
57+ }
58+ } else if ( [ 'BY' , 'NC' , 'ND' , 'SA' ] . indexOf ( stepName ) > - 1 ) {
4759 state . currentLicenseAttributes = {
4860 ...state . currentLicenseAttributes ,
4961 [ stepName ] : isSelected
You can’t perform that action at this time.
0 commit comments