Skip to content

Commit

Permalink
chore: merge branch 'chip-design' of https://github.com/dhis2/dashboa…
Browse files Browse the repository at this point in the history
…rd-app into chip-design
  • Loading branch information
martinkrulltott committed Apr 30, 2024
2 parents 1357eec + 05ff900 commit 03aeaae
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/Item/VisualizationItem/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,13 @@ class Item extends Component {
}

async componentDidMount() {
this.props.setVisualization(
await apiFetchVisualization(this.props.item)
)
// Avoid refetching the visualization already in the Redux store
// when the same dashboard item is added again.
// This also solves a flashing of all the "duplicated" dashboard items.
!this.props.visualization.id &&
this.props.setVisualization(
await apiFetchVisualization(this.props.item)
)

try {
if (
Expand Down

0 comments on commit 03aeaae

Please sign in to comment.