Skip to content

Commit

Permalink
fix: Trigger refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
memoyil committed Jan 13, 2025
1 parent 8454203 commit 7a1ba6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/canonical-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion packages/canonical-bridge/src/views/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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<ICanonicalBridgeConfig>(
() => ({
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7a1ba6a

Please sign in to comment.