From 6bff45cb32d60c0a1efb4b981a853fb7ed43ad66 Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Tue, 28 Jan 2025 10:12:34 +0100 Subject: [PATCH] fix: force visualization fetch to ensure recording for offline The visualization request stopped being recorded after recent changes. The componentDidUpdate method was taking care of the recording, but it doesn't work as before. This change ensures the visualization is fetched when the dashboard is marked for offline so that the request is properly cached. --- src/components/Item/VisualizationItem/Item.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/Item/VisualizationItem/Item.js b/src/components/Item/VisualizationItem/Item.js index 93b09b14b..c40c2ba5d 100644 --- a/src/components/Item/VisualizationItem/Item.js +++ b/src/components/Item/VisualizationItem/Item.js @@ -96,6 +96,11 @@ class Item extends Component { await apiFetchVisualization(this.props.item) ) + // force fetch when recording to allow caching of the visualizations request + if (this.props.isRecording) { + apiFetchVisualization(this.props.item) + } + try { if ( this.props.settings