From b3debe5186eb48217589daab33883e128dcf4fc7 Mon Sep 17 00:00:00 2001 From: Pavel Jankoski Date: Wed, 15 Nov 2023 12:02:01 +0100 Subject: [PATCH 1/2] console: Fix fetching stats if there are no gateways --- pkg/webui/console/store/middleware/logics/gateways.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/webui/console/store/middleware/logics/gateways.js b/pkg/webui/console/store/middleware/logics/gateways.js index 188d356d0c..bc6c756499 100644 --- a/pkg/webui/console/store/middleware/logics/gateways.js +++ b/pkg/webui/console/store/middleware/logics/gateways.js @@ -119,7 +119,10 @@ const getGatewaysLogic = createRequestLogic({ const gsConfig = selectGsConfig() const consoleGsAddress = getHostFromUrl(gsConfig.base_url) const gatewayIds = entities.map(e => e.ids) - const gatewaysStats = await tts.Gateways.getBatchStatistics(gatewayIds) + let gatewaysStats = null + if (gatewayIds.length) { + gatewaysStats = await tts.Gateways.getBatchStatistics(gatewayIds) + } entities = data.gateways.map(gateway => { const gatewayServerAddress = getHostFromUrl(gateway.gateway_server_address) From 2a1069f6acd8ec86a6ce549de3cf9583ad92277b Mon Sep 17 00:00:00 2001 From: Pavel Jankoski Date: Wed, 15 Nov 2023 12:07:25 +0100 Subject: [PATCH 2/2] console: Updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 232827f5bc..96c941485c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ For details about compatibility between different releases, see the **Commitment ### Changed - The Things Stack is now built with Go 1.21. +- Statistics for gateways are now fetched in a single request. ### Deprecated