Skip to content

Commit ccf6217

Browse files
debug: issue
1 parent b7e26a5 commit ccf6217

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

custom-implementation/src/components/theme-switch.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ export const ThemeSwitch = () => {
99
useEffect(() => {
1010
const listenToPopstate = () => {
1111
const winPath = window.location.pathname
12+
console.log('listenToPopstate called', winPath)
1213
setPath(winPath)
1314
}
15+
16+
console.log('listenToPopstate added')
1417
window.addEventListener('popstate', listenToPopstate)
1518
return () => {
1619
window.removeEventListener('popstate', listenToPopstate)
@@ -19,6 +22,7 @@ export const ThemeSwitch = () => {
1922

2023
useEffect(() => {
2124
const beta = path.split('/').includes('beta')
25+
console.log('path changed', path, beta)
2226
setSelected(beta ? 'beta' : 'public')
2327
}, [path])
2428

0 commit comments

Comments
 (0)