fix(overview): error when reading length (#188)

* fix(overview): error when reading length

* fix(connections): update WsMsg type definition

---------

Signed-off-by: nb5p <2098464+nb5p@users.noreply.github.com>
Co-authored-by: nb5p <nb5p@users.noreply.github.com>
This commit is contained in:
nb5p 2023-09-12 18:11:47 +08:00 committed by GitHub
parent 4e4f2f85c0
commit 9f227c9c2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ export default () => {
</TrafficWidget>
<TrafficWidget label={t('activeConnections')}>
{latestConnectionMsg()?.connections.length || 0}
{latestConnectionMsg()?.connections?.length || 0}
</TrafficWidget>
<TrafficWidget label={t('memoryUsage')}>

View File

@ -4,7 +4,7 @@ import { CONNECTIONS_TABLE_MAX_CLOSED_ROWS } from '~/constants'
import { Connection, ConnectionRawMessage } from '~/types'
export type WsMsg = {
connections: ConnectionRawMessage[]
connections: ConnectionRawMessage[] | null
uploadTotal: number
downloadTotal: number
} | null