From ce29fd188c9b1c3b215daa3828c7340454d1d983 Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Thu, 11 Jul 2024 09:58:47 +0200 Subject: [PATCH] fix: move visualization fetch in try/catch This is to avoid the error boundary to show up for uncaught errors (failed to fetch a visualization) which interferes with Cypress testing. --- src/components/Item/VisualizationItem/Item.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/Item/VisualizationItem/Item.js b/src/components/Item/VisualizationItem/Item.js index f17f235bf..028cdb5cc 100644 --- a/src/components/Item/VisualizationItem/Item.js +++ b/src/components/Item/VisualizationItem/Item.js @@ -88,15 +88,15 @@ class Item extends Component { } async componentDidMount() { - // 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 { + // 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) + ) + if ( this.props.settings .keyGatherAnalyticalObjectStatisticsInDashboardViews &&