fix: admin/logs: block button not considering inverted block rules

Massimo Melina committed Feb 21, 2025 at 12:40 UTC 6fb6026ff756fe7e0cd5c84dca6bb9b4f6841187
1 file changed +1 -1
admin/src/useBlockIp.ts
+1 -1
@@ -6,7 +6,7 @@ import { Block } from '@mui/icons-material'
6
7 export function useBlockIp() {
8 const { data, reload } = useApi('get_config', { only: ['block'] })
9 - const isBlocked = useCallback((ip: string) => data?.block?.find((x: any) => x.ip.includes(ip)), [data]) //TODO have a gui version of netMatches, and use that
9 + const isBlocked = useCallback((ip: string) => data?.block?.find((x: any) => x.ip.includes(ip) && !x.ip.startsWith('!')), [data]) //TODO have a gui version of netMatches, and use that
10 return {
11 iconBtn: (ip: string, comment: string, options: Partial<IconBtnProps>={}) => h(IconBtn, {
12 icon: Block,