From 3d0c51db0fd660e3d447d2882c24f59437958fe9 Mon Sep 17 00:00:00 2001 From: Eduard Gert Date: Wed, 17 Apr 2024 09:26:30 +0200 Subject: [PATCH] Add hook to check if peer has exit nodes --- src/modules/exit-node/useHasExitNodes.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/exit-node/useHasExitNodes.tsx b/src/modules/exit-node/useHasExitNodes.tsx index baf651bc..0337c5ca 100644 --- a/src/modules/exit-node/useHasExitNodes.tsx +++ b/src/modules/exit-node/useHasExitNodes.tsx @@ -5,6 +5,9 @@ import { Route } from "@/interfaces/Route"; export const useHasExitNodes = (peer?: Peer) => { const { data: routes } = useFetchApi(`/routes`); return peer - ? routes?.some((route) => route?.peer === peer.id) || false + ? routes?.some( + (route) => + route?.peer === peer.id && route?.network.includes("0.0.0.0"), + ) || false : false; };