Skip to content

Commit

Permalink
Merge pull request #6707 from TheThingsNetwork/fix/3955-error-fetchin…
Browse files Browse the repository at this point in the history
…g-stats

console: Fix fetching stats if there are no gateways
  • Loading branch information
PavelJankoski authored Nov 16, 2023
2 parents 1b7cd8d + 2a1069f commit 0c91d4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion pkg/webui/console/store/middleware/logics/gateways.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0c91d4b

Please sign in to comment.