From fb644f35738c077f49ef78870c0fc816667e3ecc Mon Sep 17 00:00:00 2001 From: pociej Date: Tue, 18 Jun 2024 15:20:27 +0200 Subject: [PATCH] chore: cleanup debug logs no issue --- deploy/backend/Dockerfile | 1 - frontend/src/components/homePage/events/events.tsx | 3 ++- frontend/src/hooks/events/useEvents.ts | 8 +++++++- frontend/src/hooks/events/useYagnaEvents.tsx | 1 - frontend/src/types/events.ts | 1 + 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/deploy/backend/Dockerfile b/deploy/backend/Dockerfile index 74ef5c0..64c2ddb 100644 --- a/deploy/backend/Dockerfile +++ b/deploy/backend/Dockerfile @@ -7,7 +7,6 @@ RUN curl -L https://join.golem.network/as-requestor --output as-requestor.sh RUN chmod +x as-requestor.sh ENV PATH="${PATH}:/root/.local/bin" -ENV DEBUG="task-executor:*" # switch yagna version if necessery ARG YAGNA_VERSION diff --git a/frontend/src/components/homePage/events/events.tsx b/frontend/src/components/homePage/events/events.tsx index 07f13e5..ee92b49 100644 --- a/frontend/src/components/homePage/events/events.tsx +++ b/frontend/src/components/homePage/events/events.tsx @@ -57,6 +57,7 @@ export const Events = () => { timestamp: number; } ) => { + console.log("event", event); setEvents((prevEvents) => { return sortBy(prop("timestamp"))( uniqBy( @@ -73,7 +74,7 @@ export const Events = () => { //TODO: fix this setTimeout(() => { sub.unsubscribe(); - }, 0); + }, 1000); }; }, []); diff --git a/frontend/src/hooks/events/useEvents.ts b/frontend/src/hooks/events/useEvents.ts index 7e58482..6e1e5c2 100644 --- a/frontend/src/hooks/events/useEvents.ts +++ b/frontend/src/hooks/events/useEvents.ts @@ -62,12 +62,18 @@ export const useEvents = ({ useEffect(() => { if (currentEvents) { + console.log("currentEvents", currentEvents); currentEvents.forEach((e: any) => { if (!previousEvents.current.find((p) => getId(p) === getId(e))) { + console.log("emitting", e); events$.current?.next(e); + } else { + console.log("not emitting", previousEvents); } }); - setIsFirstRun(false); + setTimeout(() => { + setIsFirstRun(false); + }, 1000); if (!isFirstRun) { previousEvents.current = currentEvents; } diff --git a/frontend/src/hooks/events/useYagnaEvents.tsx b/frontend/src/hooks/events/useYagnaEvents.tsx index 4720616..d048434 100644 --- a/frontend/src/hooks/events/useYagnaEvents.tsx +++ b/frontend/src/hooks/events/useYagnaEvents.tsx @@ -64,7 +64,6 @@ export const useYagnaEvent = (event: yagnaEventTopic) => { socketRef.current.connect(); socketRef.current.on("event", (data: any) => { - console.log("event", data, isInTopic(event)(data.event.eventType)); if (!isInTopic(event)(data.event.eventType)) return; emit({ id: data.id, ...data[event] }, data.event.eventType); }); diff --git a/frontend/src/types/events.ts b/frontend/src/types/events.ts index fd2b0ae..5a43e89 100644 --- a/frontend/src/types/events.ts +++ b/frontend/src/types/events.ts @@ -56,6 +56,7 @@ export type Payload = { agreementId: string; invoiceId: string; transactionId?: string; + amount: string; }; [Event.AGREEMENT_SIGNED]: {