diff --git a/packages/canonical-bridge/package.json b/packages/canonical-bridge/package.json index 610ec8a46ce35..46f07d52e730c 100644 --- a/packages/canonical-bridge/package.json +++ b/packages/canonical-bridge/package.json @@ -29,7 +29,8 @@ "@solana/wallet-adapter-react": "^0", "@tronweb3/tronwallet-adapter-react-hooks": "^1", "@pancakeswap/uikit": "workspace:*", - "@pancakeswap/localization": "workspace:*" + "@pancakeswap/localization": "workspace:*", + "@pancakeswap/hooks": "workspace:*" }, "dependencies": { "@bnb-chain/canonical-bridge-widget": "0.5.15", diff --git a/packages/canonical-bridge/src/views/index.tsx b/packages/canonical-bridge/src/views/index.tsx index 43613bcc5cf27..b4690da5af14a 100644 --- a/packages/canonical-bridge/src/views/index.tsx +++ b/packages/canonical-bridge/src/views/index.tsx @@ -11,6 +11,7 @@ import { } from '@bnb-chain/canonical-bridge-widget' import { useTheme } from 'styled-components' import { useAccount } from 'wagmi' +import { useLastUpdated } from '@pancakeswap/hooks' import { RefreshingIcon } from '../components/RefreshingIcon' import { V1BridgeLink } from '../components/V1BridgeLink' import { chains, env } from '../configs' @@ -35,15 +36,17 @@ export const CanonicalBridge = (props: CanonicalBridgeProps) => { const { currentLanguage } = useTranslation() const theme = useTheme() const toast = useToast() + const { setLastUpdated: refresh } = useLastUpdated() useEffect(() => { if (typeof document !== 'undefined') { const inputElement = document.querySelector('.bccb-widget-transfer-input') if (inputElement) { inputElement.setAttribute('pattern', '^[0-9]*[.,]?[0-9]*$') + refresh() } } - }, []) + }, [refresh]) const config = useMemo( () => ({ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index df5491e17ec5c..6494d187b4ad6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1566,6 +1566,9 @@ importers: '@emotion/styled': specifier: ^11 version: 11.11.5(@emotion/react@11.11.4(@types/react@18.2.37)(react@18.2.0))(@types/react@18.2.37)(react@18.2.0) + '@pancakeswap/hooks': + specifier: workspace:* + version: link:../hooks '@solana/spl-token': specifier: ^0 version: 0.4.9(@solana/web3.js@1.87.6(bufferutil@4.0.8)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.2.2)(utf-8-validate@5.0.10)