Compare commits

..

No commits in common. "69402fd4c6dfb6e016d9a147836393bdcafa7a05" and "f1caef10587615e305ebc25adfcebee26ebeb6f6" have entirely different histories.

View file

@ -25,7 +25,7 @@ export function Nav({
t: typeof translations.pl t: typeof translations.pl
}) { }) {
const { theme, setTheme } = useTheme() const { theme, setTheme } = useTheme()
const [activeSection] = useState<Sections>("about") const [activeSection, setActiveSection] = useState<Sections>("about")
useEffect(() => { useEffect(() => {
@ -44,8 +44,8 @@ export function Nav({
entries.forEach(entry => { entries.forEach(entry => {
const target = entry.target.id as keyof (typeof translations.pl)["nav"] const target = entry.target.id as keyof (typeof translations.pl)["nav"]
if (entry.isIntersecting) { if (entry.isIntersecting) {
// setActiveSection(target); setActiveSection(target);
if (history.replaceState) { if (window.location.hash !== `#${target}` && history.replaceState) {
timeout = setTimeout(() => { timeout = setTimeout(() => {
history.replaceState(null, "", `#${target}`) history.replaceState(null, "", `#${target}`)
}, 150) }, 150)