fix: admin/monitoring: agent "undefined" displayed
Massimo Melina committed
Feb 24, 2024 at 15:16 UTC
48237a712bc51d56ee96880ca68ecc4caede5eb0
1 file changed
+3
-3
admin/src/LogsPage.ts
+3
-3
@@ -144,8 +144,7 @@ function LogFile({ file, pause, showApi }: { file: string, pause?: boolean, show
144
width: 60,
145
hidden: !showAgent,
146
valueGetter: ({ row }) => row.extra?.ua,
147
- renderCell: ({ value }) =>
148
- value && agentIcons(value),
147
+ renderCell: ({ value }) => agentIcons(value),
148
},
149
{
150
field: 'notes',
@@ -178,7 +177,8 @@ function LogFile({ file, pause, showApi }: { file: string, pause?: boolean, show
177
})
178
}
179
181
-export function agentIcons(agent: string) {
180
+export function agentIcons(agent: string | undefined) {
181
+ if (!agent) return
182
const UW = 'https://upload.wikimedia.org/wikipedia/commons/'
183
const short = shortenAgent(agent)
184
const browserIcon = icon(short, {