Skip to content

Commit

Permalink
fix: move visualization fetch in try/catch
Browse files Browse the repository at this point in the history
This is to avoid the error boundary to show up for uncaught errors
(failed to fetch a visualization) which
interferes with Cypress testing.
  • Loading branch information
edoardo committed Jul 11, 2024
1 parent ade516a commit ce29fd1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/Item/VisualizationItem/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit ce29fd1

Please sign in to comment.