File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { useEffect , useState } from 'react'
2
+ import { useRouter } from 'next/router'
2
3
import Cookies from 'js-cookie'
3
4
import { UnderlineNav } from '@primer/react'
4
5
import { sendEvent , EventType } from 'components/lib/events'
@@ -75,6 +76,7 @@ type Props = {
75
76
variant ?: 'subnav' | 'tabnav' | 'underlinenav'
76
77
}
77
78
export const ToolPicker = ( { variant = 'subnav' } : Props ) => {
79
+ const { asPath } = useRouter ( )
78
80
const { defaultTool, detectedTools } = useArticleContext ( )
79
81
const [ currentTool , setCurrentTool ] = useState ( getDefaultTool ( defaultTool , detectedTools ) )
80
82
@@ -100,7 +102,7 @@ export const ToolPicker = ({ variant = 'subnav' }: Props) => {
100
102
preserveAnchorNodePosition ( document , ( ) => {
101
103
showToolSpecificContent ( currentTool )
102
104
} )
103
- } , [ currentTool ] )
105
+ } , [ currentTool , asPath ] )
104
106
105
107
function onClickTool ( tool : string ) {
106
108
setCurrentTool ( tool )
You can’t perform that action at this time.
0 commit comments