From fe5866f98114a92fbbd536096e7d9de903290454 Mon Sep 17 00:00:00 2001 From: quangdz1704 Date: Wed, 17 Jul 2024 15:40:08 +0700 Subject: [PATCH] fix: build --- .husky/pre-push | 4 ++++ components/page/bridge/hooks/useGetFee.ts | 18 ++++++++++++------ package.json | 1 + yarn.lock | 5 +++++ 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100755 .husky/pre-push diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 0000000..2f5f0f6 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +yarn build \ No newline at end of file diff --git a/components/page/bridge/hooks/useGetFee.ts b/components/page/bridge/hooks/useGetFee.ts index 3e388cc..1b56334 100644 --- a/components/page/bridge/hooks/useGetFee.ts +++ b/components/page/bridge/hooks/useGetFee.ts @@ -16,12 +16,6 @@ const useGetFee = ({ const [bridgeFee, setBridgeFee] = useState(0); const [tokenFee, setTokenFee] = useState(0); - const tonBridgeClient = new TonbridgeBridgeClient( - window.client, - oraiAddress, - network.CW_TON_BRIDGE - ); - useEffect(() => { (async () => { if (token) { @@ -32,6 +26,12 @@ const useGetFee = ({ return; } + const tonBridgeClient = new TonbridgeBridgeClient( + window.client, + oraiAddress, + network.CW_TON_BRIDGE + ); + const tokenFeeConfig = await tonBridgeClient.tokenFee({ remoteTokenDenom: tokenInTon?.contractAddress, }); @@ -51,6 +51,12 @@ const useGetFee = ({ useEffect(() => { (async () => { + const tonBridgeClient = new TonbridgeBridgeClient( + window.client, + oraiAddress, + network.CW_TON_BRIDGE + ); + const config = await tonBridgeClient.config(); if (config) { const { relayer_fee } = config; diff --git a/package.json b/package.json index 608589b..e0a54ad 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "@types/react-dom": "^18", "eslint": "^8", "eslint-config-next": "14.2.4", + "husky": "^9.0.11", "patch-package": "^8.0.0", "sass": "^1.77.6", "typescript": "^5" diff --git a/yarn.lock b/yarn.lock index 27df3d7..563d18e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5561,6 +5561,11 @@ https-proxy-agent@^7.0.1, https-proxy-agent@^7.0.3, https-proxy-agent@^7.0.5: agent-base "^7.0.2" debug "4" +husky@^9.0.11: + version "9.0.11" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.11.tgz#fc91df4c756050de41b3e478b2158b87c1e79af9" + integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw== + iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"