From 571df764044bb211c234bfec72bcec9847faf379 Mon Sep 17 00:00:00 2001 From: Immortal Date: Sat, 2 Mar 2024 23:08:41 +0330 Subject: [PATCH] Update useIPScanner.ts --- src/hooks/useIPScanner.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useIPScanner.ts b/src/hooks/useIPScanner.ts index 54eb247..f2126d6 100644 --- a/src/hooks/useIPScanner.ts +++ b/src/hooks/useIPScanner.ts @@ -138,13 +138,13 @@ export const useIPScanner = ({ allIps }: IPScannerProps) => { async function startScan() { reset(); try { - dispatch({ scanState: "scanning" }); - setToIdle(); const ips = state.ipRegex ? allIps.filter((el) => new RegExp(state.ipRegex).test(el)) : allIps; + dispatch({ scanState: "scanning" }); await testIPs(randomizeElements(ips)); + setToIdle(); } catch (e) { console.error(e); }