Open brucecrevensten opened 1 month ago
It looks like the number of identical API HTTP requests corresponds to the number of charts that are displayed on the ARDAC item. Since the permafrost-magt item displays 7 charts (one chart for each MAGT depth), it fires off 7 requests. Similarly, the permafrost base & top item fires off 2 identical HTTP requests since it displays two charts.
I haven't dug into this very deep, but here's the watch function that fires off the permafrost API HTTP request:
And I suspect this line is the culprit:
In other words, it appears that each time PermafrostChart.vue
is mounted, it sets a new latLng
computed property for that instance of PermafrostChart.vue
and triggers another API fetch.
There are probably several ways to fix this, but it might make the most sense to move these two lines of code out of the PermafrostChart.vue
component's watch function and into a similar watch function inside PermafrostChartControls.vue
(which only gets mounted once regardless of the number of charts):
dataStore.apiData = null
dataStore.fetchData('permafrost')
HydrologyChart.vue
/ HydrologyChartControls.vue
also.IndicatorsCmip6Chart.vue
/ IndicatorsCmip6ChartControls.vue
also even though the CMIP6 indicator items don't have this problem since no CMIP6 indicator item has multiple charts (yet).
STR:
Env: API = development.earthmaps.io / Rasdaman = zeus
I'm seeing 7 HTTP requests fired off for the same target data. This doesn't seem right!