fixed reference error for undefined returns for latest message counts

This commit is contained in:
TzeYiing committed 2021-12-03 01:06:37 +08:00
1 parent 718cf57e02
commit e2770cfbce
1 file changed
+1 -1
@@ -55,7 +55,7 @@ export const LogPage = () => {
} = useSWR<{ data: [CountData] | [], error?: any }>(countKey, get, {
refreshInterval: 5000
})
const newCount = countData?.data[0]?.count
const newCount = countData?.data?.[0]?.count
const { data: logData, error } = data || {}
const handleRefresh = () => {