From 9d8d06b922e72c63c541a3594915ee82050819c9 Mon Sep 17 00:00:00 2001 From: Yongfeng LI Date: Wed, 6 Nov 2024 16:22:31 +0800 Subject: [PATCH] Temp, #925 --- site/src/hooks/overview/useLatestBlocks.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 site/src/hooks/overview/useLatestBlocks.js diff --git a/site/src/hooks/overview/useLatestBlocks.js b/site/src/hooks/overview/useLatestBlocks.js new file mode 100644 index 00000000..7394138c --- /dev/null +++ b/site/src/hooks/overview/useLatestBlocks.js @@ -0,0 +1,15 @@ +import { useInterval } from "react-use"; +import { getEnvChain } from "../../utils/env"; +import chains from "../../utils/consts/chains"; +import { useDispatch } from "react-redux"; +import { useCallback } from "react"; + +export default function useLatestBlocks() { + const chain = getEnvChain(); + const isRelay = [chains.polkadot.value, chains.kusama.value].includes(chain); + const dispatch = useDispatch(); + + const fetchBlocks = useCallback(() => {}, []); + + useInterval(() => {}, isRelay ? 6000 : 12000); +}