fix(navigation): not updating style and background image

This commit is contained in:
Anhgelus Morhtuuzh 2024-12-10 20:39:13 +01:00
parent 8f86a7299d
commit 40fe301b54
No known key found for this signature in database
GPG key ID: CAD341EFA92DDDE5

View file

@ -23,10 +23,7 @@ function changePage(href: string) {
const doc = new DOMParser().parseFromString(html, "text/html") const doc = new DOMParser().parseFromString(html, "text/html")
window.history.pushState({}, "", href) window.history.pushState({}, "", href)
document.title = doc.title document.title = doc.title
const distMain = doc.querySelector("main") document.body = doc.body
const currentMain = document.querySelector("main")
if (distMain === null || currentMain === null) document.body = doc.body
else currentMain.innerHTML = distMain.innerHTML
setupEvents() setupEvents()
scrollTo({ scrollTo({
top: 0, top: 0,