Skip to content

Commit

Permalink
refactor: only dispatch addMetadata when there is something to add
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkrulltott committed Jan 3, 2024
1 parent 9b24adf commit 2c869f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,9 @@ const App = () => {
}
}
}

dispatch(acAddMetadata(optionSetsMetadata))
if (Object.keys(optionSetsMetadata).length) {
dispatch(acAddMetadata(optionSetsMetadata))
}
}

const addTrackedEntityTypeMetadata = (visualization) => {
Expand Down

0 comments on commit 2c869f4

Please sign in to comment.