From 275a2cf933606bd9b00ea185f6cede97b0620154 Mon Sep 17 00:00:00 2001 From: JayJay1024 Date: Thu, 23 May 2024 09:53:47 +0800 Subject: [PATCH 1/2] Update pollInterval of history fetching --- src/hooks/use-history-details.ts | 2 +- src/hooks/use-history.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/use-history-details.ts b/src/hooks/use-history-details.ts index 2f4b5d49..267726f2 100644 --- a/src/hooks/use-history-details.ts +++ b/src/hooks/use-history-details.ts @@ -7,7 +7,7 @@ export function useHistoryDtails(txHash: Hash | null | undefined) { const { loading, data } = useQuery(GQL_GET_HISTORY_DETAILS, { variables: { txHash: txHash ?? "" }, fetchPolicy: "no-cache", - pollInterval: txHash ? 3000 : 0, + pollInterval: txHash ? 4500 : 0, skip: !txHash, }); diff --git a/src/hooks/use-history.ts b/src/hooks/use-history.ts index 144a4aa9..a975e187 100644 --- a/src/hooks/use-history.ts +++ b/src/hooks/use-history.ts @@ -13,7 +13,7 @@ export function useHistory(page: number, enabled?: boolean) { } = useQuery(GQL_GET_HISTORY, { variables: { bridges: ["lnv2-opposite", "lnv2-default", "lnv3"], sender: account.address, row: 10, page }, fetchPolicy: "no-cache", - pollInterval: enabled ? 3500 : 0, + pollInterval: enabled ? 3000 : 0, skip: !enabled, }); From 9e412782eff9c04c81fde57d8879ca662c66ce71 Mon Sep 17 00:00:00 2001 From: JayJay1024 Date: Thu, 23 May 2024 09:56:24 +0800 Subject: [PATCH 2/2] Fix useHistoryDetails typo --- src/components/history/history-details.tsx | 4 ++-- src/hooks/use-history-details.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/history/history-details.tsx b/src/components/history/history-details.tsx index f8a6d029..91b1137b 100644 --- a/src/components/history/history-details.tsx +++ b/src/components/history/history-details.tsx @@ -11,7 +11,7 @@ import { import { Hash, Hex, isHash } from "viem"; import Completed from "../icons/completed"; import Pending from "../icons/pending"; -import { useHistoryDtails } from "../../hooks"; +import { useHistoryDetails } from "../../hooks"; import ComponentLoading from "../../ui/component-loading"; import { useMemo } from "react"; @@ -21,7 +21,7 @@ interface Props { } export default function HistoryDetails({ defaultData, requestTxHash }: Props) { - const { data: _data, loading } = useHistoryDtails(requestTxHash); + const { data: _data, loading } = useHistoryDetails(requestTxHash); const data = useMemo(() => _data ?? defaultData, [_data, defaultData]); const sourceChain = getChainConfig(data?.fromChain); diff --git a/src/hooks/use-history-details.ts b/src/hooks/use-history-details.ts index 267726f2..ed1b7e3a 100644 --- a/src/hooks/use-history-details.ts +++ b/src/hooks/use-history-details.ts @@ -3,7 +3,7 @@ import { GQL_GET_HISTORY_DETAILS } from "../config"; import { HistoryDetailsReqParams, HistoryDetailsResData } from "../types"; import { useQuery } from "@apollo/client"; -export function useHistoryDtails(txHash: Hash | null | undefined) { +export function useHistoryDetails(txHash: Hash | null | undefined) { const { loading, data } = useQuery(GQL_GET_HISTORY_DETAILS, { variables: { txHash: txHash ?? "" }, fetchPolicy: "no-cache",