Skip to content

Commit

Permalink
js: fix import reducer selectChangedElements showChangedElements
Browse files Browse the repository at this point in the history
Signed-off-by: David Wallace <[email protected]>
  • Loading branch information
MyPyDavid committed Mar 8, 2024
1 parent 079194e commit 66126ea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rdmo/management/assets/js/reducers/importsReducer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import isArray from 'lodash/isArray'
import isNil from 'lodash/isNil'
import isUndefined from 'lodash/isUndefined'
import { isEmpty } from 'lodash'

import { buildUri } from '../utils/elements'

Expand Down Expand Up @@ -58,7 +57,7 @@ export default function importsReducer(state = initialState, action) {
})}
case 'import/selectChangedElements':
return {...state, elements: state.elements.map(element => {
if (element.updated && !isEmpty(element.updated_and_changed) && !element.created ) {
if (element.updated && element.changed && !element.created ) {
return {...element, import: action.value}
}
else if (action.value) {return {...element, import: !action.value}}
Expand All @@ -71,7 +70,7 @@ export default function importsReducer(state = initialState, action) {
})}
case 'import/showChangedElements':
return {...state, elements: state.elements.map(element => {
if (element.updated && !isEmpty(element.updated_and_changed) && !element.created ) {
if (element.updated && element.changed && !element.created ) {
return {...element, show: action.value}
}
else if (action.value) {return {...element, show: !action.value}}
Expand Down

0 comments on commit 66126ea

Please sign in to comment.