Skip to content

Commit 390d339

Browse files
authored
Merge pull request #1677 from mars-protocol/develop
v3.0.0
2 parents fdbe93a + a0f61ef commit 390d339

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/pages/_layout.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ import useChainConfig from 'hooks/chain/useChainConfig'
1818
import useCurrentChainId from 'hooks/localStorage/useCurrentChainId'
1919
import useLocalStorage from 'hooks/localStorage/useLocalStorage'
2020
import { useSkipBridgeStatus } from 'hooks/localStorage/useSkipBridgeStatus'
21-
import { Suspense, useEffect } from 'react'
21+
import { Suspense, useEffect, useMemo } from 'react'
2222
import { isMobile } from 'react-device-detect'
2323
import { useLocation } from 'react-router-dom'
2424
import useStore from 'store'
2525
import { SWRConfig } from 'swr'
2626
import { debugSWR } from 'utils/middleware'
27+
import { getPage } from 'utils/route'
2728

2829
interface Props {
2930
focusComponent: FocusComponent | null
@@ -90,6 +91,16 @@ export default function Layout({ children }: { children: React.ReactNode }) {
9091
}
9192
}, [chainConfig.id, currentChainId, setCurrentChainId])
9293

94+
const page = getPage(location.pathname, chainConfig)
95+
const [isHls, isV1, isVaults] = useMemo(
96+
() => [page.split('-')[0] === 'hls', page === 'v1', page.includes('vaults')],
97+
[page],
98+
)
99+
100+
useEffect(() => {
101+
useStore.setState({ isHls, isV1, isVaults })
102+
}, [isHls, isV1, isVaults])
103+
93104
return (
94105
<>
95106
<ErrorBoundary errorStore={errorStore}>

0 commit comments

Comments
 (0)