From 1bac4bd6ab970c0ed9c352261119ca1c0d21c09b Mon Sep 17 00:00:00 2001 From: danisharora099 Date: Fri, 15 Sep 2023 16:53:14 +0530 Subject: [PATCH] chore: use BaseProtocol.multicodec instead of exported codec --- examples/web-chat/src/hooks.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/web-chat/src/hooks.ts b/examples/web-chat/src/hooks.ts index 97a0190..d70c2f7 100644 --- a/examples/web-chat/src/hooks.ts +++ b/examples/web-chat/src/hooks.ts @@ -3,7 +3,6 @@ import { generate } from "server-name-generator"; import { Message } from "./Message"; import { EPeersByDiscoveryEvents, LightNode, Tags } from "@waku/interfaces"; import type { PeerId } from "@libp2p/interface-peer-id"; -import { waku } from "@waku/sdk"; import { useFilterMessages, useStoreMessages } from "@waku/react"; import type { @@ -196,16 +195,13 @@ export const usePeers = (params: UsePeersParams): UsePeersResults => { setPeers({ allConnected: peers.map((p) => p.id), storePeers: peers - .filter((p) => p.protocols.includes(waku.waku_store.StoreCodec)) + .filter((p) => p.protocols.includes(node.store?.multicodec || "")) .map((p) => p.id), - //TODO: use from import filterPeers: peers - .filter((p) => - p.protocols.includes("/vac/waku/filter-subscribe/2.0.0-beta1") - ) + .filter((p) => p.protocols.includes(node.filter?.multicodec || "")) .map((p) => p.id), // hardcoding codec since we don't export it currently lightPushPeers: peers - .filter((p) => p.protocols.includes(waku.waku_store.StoreCodec)) + .filter((p) => p.protocols.includes(node.lightPush?.multicodec || "")) .map((p) => p.id), }); };