Skip to content

Commit

Permalink
Add hook to check if peer has exit nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
heisbrot committed Apr 17, 2024
1 parent 4684a87 commit 3d0c51d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/modules/exit-node/useHasExitNodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { Route } from "@/interfaces/Route";
export const useHasExitNodes = (peer?: Peer) => {
const { data: routes } = useFetchApi<Route[]>(`/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;
};

0 comments on commit 3d0c51d

Please sign in to comment.