Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console: Fix fetching stats if there are no gateways #6707

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading